-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
'jsx' is not exported by node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js #5
Comments
Is this still happening with the latest Vite version? The new optimizer might hide this issue unless you return to the old way with |
It fixed the repro above (simpler setup) but still fails in https://github.com/uber/baseweb/pull/new/vite-beta When running 'render' is not exported by node_modules/.vite/deps_build-99968c8c/react-dom.js, imported by node_modules/@ladle/react/lib/app/src/index.tsx
file: /Users/vojtech/Projects/baseweb/node_modules/@ladle/react/lib/app/src/index.tsx:4:0
2: import * as React from "react";
3: import * as ReactDOMClient from "react-dom/client";
4: import { render } from "react-dom"; If I change that import to
it finishes the build but with a lot of warnings like this:
And the application is broken
Anyway, I started digging into the
If you have any pointers what should I look into it would be appreciated. I really want to understand this better and fix it. |
The build works fine with legacy: {
buildRollupPluginCommonjs: true
} |
For me the issue is gone after using @vitejs/plugin-react 2.0.0-beta.1 |
@tajo Sorry i've been busy and missed this. I'm not familiar enough with plugin-react to know the context behind the code, but re |
"@vitejs/plugin-react": "2.0.0-beta.1",
"vite": "3.0.0-beta.7" I still observe the issue. |
(I don't know if it's related but I get the same error when trying to shim the import inject from '@rollup/plugin-inject';
export default defineConfig({
plugins: [
inject({
....,
process: 'process/browser',
}),
]
}) |
I tested ladle with Vite 4 + plugin-react 3 with the following config (to enable build-time optimize-deps) and it worked. import { defineConfig } from "vite";
export default defineConfig({
optimizeDeps: {
disabled: false,
},
build: {
commonjsOptions: {
include: [],
},
},
}); Closing as I guess this is now fixed. |
I am facing this exact issue with v3.0 and vite 4.0.2.
This is my config:
I need to have the optimizeDeps and commonJs config. Any ideas on what I can do? EditDropping down to v2.2.0 and adding
|
@nonara Would you create a new issue with reproduction? Thanks. |
Describe the bug
Testing the main branch (including vitejs/vite#8546) since vite@3-alpha10 doesn't work for production builds of Ladle.
vite
repo (using pnpm overrides)ladle/packages/example
pnpm ladle build
Log:
If you try to run the server with
build
folder you get some generic error:(Is there a simple way how I could do this repro with StackBlitz?)
Reproduction
https://github.com/tajo/ladle/tree/test-vite
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: