You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot find module 'node_modules/react/jsx-runtime' imported from 'node_modules/@tw-classed/react/dist/index.mjs' when used from a component library
#78
Closed
searchableguy opened this issue
Jan 3, 2023
Discussed in
#76
· 3 comments
I use tw-classed in a component library package which is built by vite. I'm facing this error when I try to import the library in a nextjs app if tw-classed/react is listed as a dependency.
After looking into it, it seems to be react 17 issue facebook/create-react-app#11769facebook/react#20235 which was apparently fixed in 18. I upgraded to 18 in our next app but that didn't resolve anything so my guess there is also something with nextjs that affects this. vercel/next.js#27977
I've not been able to find a way to work around this so I decided to create an issue. Feel free to close this if it's relevant.
The text was updated successfully, but these errors were encountered:
searchableguy
changed the title
Cannot find module 'node_modules/react/jsx-runtime' imported from 'node_modules/@tw-classed/react/dist/index.mjs'
Cannot find module 'node_modules/react/jsx-runtime' imported from 'node_modules/@tw-classed/react/dist/index.mjs' when used from a component library
Jan 3, 2023
I've tried to reproduce this. Published a component lib to npm using tw-classed and export Button component. Then I installed this lib first in a Next.js react-18 app, and a Vite react 17 app.
Discussed in #76
I use tw-classed in a component library package which is built by vite. I'm facing this error when I try to import the library in a nextjs app if
tw-classed/react
is listed as a dependency.After looking into it, it seems to be react 17 issue facebook/create-react-app#11769 facebook/react#20235 which was apparently fixed in 18. I upgraded to 18 in our next app but that didn't resolve anything so my guess there is also something with nextjs that affects this. vercel/next.js#27977
I've not been able to find a way to work around this so I decided to create an issue. Feel free to close this if it's relevant.
The text was updated successfully, but these errors were encountered: