-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
react/jsx-runtime breaks dev builds #8069
Comments
FYI, was able to reproduce what you described. It worked on first run doing However, adding in Below should fix it for you: import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
optimizeDeps: {
include: ['react/jsx-runtime'],
},
}); |
I added your answer to vite config and tried again. /packages/components/vite.config.ts /packages/react-clone/vite.config.ts Put the same contents in the above two files, build It didn't work yesterday, but today it worked! I feel like I had to change all vite.config.ts the same. thank you. |
Success! |
Describe the bug
I am sharing a link to my project repository.
https://github.com/katanazero86/react-clone/tree/master/packages/react-clone
If you get clone and run npm run dev after npm i, it works normally.
However, after touching tsconfig to build the project, an error occurs.
/packages/components/tsconfig.json
/packages/react-clone/package.json
After modifying for the build as above, proceed with the build and run it, it works normally.
But.. after running it with npm run dev
jsx-runtime.js:6 Uncaught ReferenceError: module is not defined at jsx-runtime.js:6:3
An error occurs.
The project consists of an npm workspace.
I referenced this issue (#6215), but it didn't solve the error.
Reproduction
https://github.com/katanazero86/react-clone/tree/master/packages/react-clone
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: