Failed to resolve module specifier "react/jsx-runtime" #16411
-
Describe the bugI am aware that this is older issue and I just can't resolve it, I sow this comment and I would really appreciate explanation on how to because i don't use that module at all anywhere..
Reproductionhttps://stackblitz.com/~/github.com/Digital39999/remix-vite-test Steps to reproduceRun System InfoSystem:
OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (4) x64 Intel(R) N100
Memory: 7.49 GB / 11.43 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 20.12.1 - ~/.nvm/versions/node/v20.12.1/bin/node
npm: 10.5.1 - ~/.nvm/versions/node/v20.12.1/bin/npm
pnpm: 8.15.6 - ~/.nvm/versions/node/v20.12.1/bin/pnpm
npmPackages:
@vitejs/plugin-react: ^4.2.1 => 4.2.1
vite: ^5.2.6 => 5.2.6 Used Package Managerpnpm LogsNo response Validations
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
It looks like you're using Remix but I don't think they mention using it together with |
Beta Was this translation helpful? Give feedback.
-
The error is happening because React is externalized for the client bundle. Browsers doesn't know where If that is what you intend, you'll need to map If you just want to externalize React for the SSR bundle, removing |
Beta Was this translation helpful? Give feedback.
-
Thanks for help, I never thought that such thing could cause whole website to break, removing |
Beta Was this translation helpful? Give feedback.
As far as I know,
vite-plugin-externalize-deps
is not most intuitive thing to for normal users just bundling an app. It's like telling Vite to keepimport "react"
in your source code instead of bundling the dependencies.vite-plugin-externalize-deps
could be convenient for developing a library where you don't want to bundle the wholereact
into your component library.I don't think Remix team has ever mentioned
vite-plugin-externalize-deps
, so I just wonder where you got this idea from.You don't normally i…