Related plugins
Describe the bug
I started from the base example and added two plugins: a Deno plugin and the official cjs-to-esm plugin. I also import a component from the base UI lib. After these changes the app ends up with a duplicate instance of React (two React copies), which breaks hooks and causes errors like “Invalid hook call”.
What I changed
• Based this on the base example
• Added a Deno resolution plugin (same as the one discussed in vitejs/vite#20849 )
• Added cjstoesm (cjs-to-esm) plugin
• Imported a component from the base UI lib
Expected behavior: Single React instance used across the app and plugins; no hook errors.
Actual behavior: Duplicate React instance (two copies), causing hook errors and runtime issues.
Reproduction
https://github.com/nestarz/deno-vite-issue-3
Steps to reproduce
-
Clone https://github.com/nestarz/deno-vite-issue-3
-
Install deps / follow repo’s README to run dev build
-
Start dev server (or build)
-
Load the app and observe console errors about duplicate React/Invalid hook call
System Info
Used Package Manager
npm
Logs
No response
Validations
Related plugins
plugin-react
plugin-react-swc
plugin-react-oxc
plugin-rsc
Describe the bug
I started from the base example and added two plugins: a Deno plugin and the official cjs-to-esm plugin. I also import a component from the base UI lib. After these changes the app ends up with a duplicate instance of React (two React copies), which breaks hooks and causes errors like “Invalid hook call”.
What I changed
• Based this on the base example
• Added a Deno resolution plugin (same as the one discussed in vitejs/vite#20849 )
• Added cjstoesm (cjs-to-esm) plugin
• Imported a component from the base UI lib
Expected behavior: Single React instance used across the app and plugins; no hook errors.
Actual behavior: Duplicate React instance (two copies), causing hook errors and runtime issues.
Reproduction
https://github.com/nestarz/deno-vite-issue-3
Steps to reproduce
Clone https://github.com/nestarz/deno-vite-issue-3
Install deps / follow repo’s README to run dev build
Start dev server (or build)
Load the app and observe console errors about duplicate React/Invalid hook call
System Info
Used Package Manager
npm
Logs
No response
Validations