-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cannot find module .../jsx-runtime
#2468
Comments
I can confirm this is an |
Your files need to be processed by Vitest (they are externalised in your case). Add this to your export default {
test: {
deps: {
inline: [/@just-web/, /just-web-react/]
},
},
} I was also able to fix the issue by adding |
awesome! thanks for the quick response. 🌷 |
I was also able to patch {
"exports": {
".": {
"default": "./index.js"
},
"./jsx-runtime": {
"default": "./jsx-runtime.js"
},
"./jsx-dev-runtime": {
"default": "./jsx-dev-runtime.js"
}
}
} This all is required, because if you delegate executing to Node (which is enabled for your package here), then it kicks it's own resolution mechanism instead of Vite's, and it doesn't support importing This is unfortunately sad ESM<->CJS reality that we have to live in. |
Yeah, I'm using React 17 which does not have the Maybe I can file a PR to React to fix that in 17 (17.0.3) |
Have a look at this issue and it'll never be fixed for react 16 and 17 |
Describe the bug
I have a library that depends on another library. Both using
vite
to build withreact@17
, TypeScript,pnpm
, and in ESM.The build works fine, but
vitest
failed with:Reproduction
Since it involves one library referencing another, it will take some effort to come up with a minimal repro.
For the time being, here is the code:
git checkout jsx-runtime-error
pnpm install
pnpm build
pnpm commands test
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: