-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error ' ...does not provide an export named 'jsx' ' #132
Comments
I think it is caused by vitejs/vite-plugin-react#132 introduced in
I will look into it and find the actual fix in this weekend. |
The repo link is also the team name so I was notified about this issue. |
@ArnaudBarre I think it should support "react/jsx-runtime" during dev. Because npm packages may transform jsx code into "js code with react/jsx-runtime" before published. And users may use these packages during dev. That cause "react/jsx-runtime" being imported during dev. In this specific case, our framework have some client code that is built into "js code with react/jsx-runtime": Another example is component library: https://unpkg.com/browse/@mui/[email protected]/Button/Button.js |
I'm surprised that this is not pick by Vite if this is in the dependency code. Sounds like very common to have a lib use in dev that is only present in node_modules |
Yes. If the npm package is optimized by vite, importing In this specific case, I add Could |
The small issue here is that now all users will pre-bundle this package even if not used. I'm surprised that the missing entry creates an error instead of late optimisation + page reload on cold start |
You are right. Vite should found out that some imported package need optimization. I have created a reproduction: https://stackblitz.com/edit/vitejs-vite-euyrbc?file=src%2FApp.tsx,vite.config.ts,package.json&terminal=dev mui encounter similar issue with prop-types in this demo. We have to add mui package to |
I fix this in on vite-plugin-react-pages's side by adding By the way, I think vite (or |
Hi, when i update dependency @vitejs/plugin-react in library-monorepo-demo to latest version 4.0.0 i get error after starting app in dev
The rest npm scripts ( build or ssr )continue working fine.
There is any thing i should configure to make dev script to function properly?
The text was updated successfully, but these errors were encountered: