Replies: 2 comments 2 replies
-
Any luck with this ? Can't seem to figure out a solution for it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think Node.js runtime is having trouble with named exports
or call for jsx like:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version
v20.9.0
Platform
Linux dsw-280180-68d74df5b8-pnl6f 4.19.24-7.34.cbp.al7.x86_64 #1 SMP Tue Jun 20 06:15:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
next,node
What steps will reproduce the bug?
development:
next start works fine.
then build:
pnpm --filter=app run build
in production environment:
node server.js failed.
⨯ file:///projext/node_modules/.pnpm/registry.npmmirror.com+@chakra-ui+css-reset@2.3.0_@emotion[email protected][email protected]/node_modules/@chakra-ui/css-reset/dist/chunk-B4LBJQ3X.mjs:5
import { jsx } from "react/jsx-runtime";
^^^
SyntaxError: Named export 'jsx' not found. The requested module 'react/jsx-runtime' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'react/jsx-runtime';
const { jsx } = pkg;
⨯ file:///projext/node_modules/.pnpm/registry.npmmirror.com+@chakra-ui+css-reset@2.3.0_@emotion[email protected][email protected]/node_modules/@chakra-ui/css-reset/dist/chunk-B4LBJQ3X.mjs:5
import { jsx } from "react/jsx-runtime";
^^^
SyntaxError: Named export 'jsx' not found. The requested module 'react/jsx-runtime' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'react/jsx-runtime';
const { jsx } = pkg;
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
node works fine
What do you see instead?
node run fails
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions