signals/react: 'default' is not exported by react/jsx-runtime
See original GitHub issueWhen trying to generate a production build in a Vite react app, we get the following error:
'default' is not exported by react/jsx-runtime, imported by node_modules/@preact/signals-react/dist/signals.module.js
It appears this error originates from these lines https://github.com/preactjs/signals/blob/main/packages/react/src/index.ts#L9-L10, where it’s using default imports for the two runtimes, while the jsx-runtime
package appears to only provide named exports?
Issue Analytics
- State:
- Created 10 months ago
- Reactions:4
- Comments:5
Top Results From Across the Web
Error: 'default' is not exported by react/jsx-runtime, imported by ...
Description calling preact signal for state management causes error in react-ts app To Reproduce wails init -n myproject -t react-ts cd frontend &&...
Read more >Error: 'jsxs' is not exported by node_modules/react/jsx-runtime ...
I ended up having to add react/jsx-runtime to external in the ... export default [ { input: 'src/Icons/index.ts', output: [ { file: ...
Read more >TSConfig Option: jsxImportSource - TypeScript
Declares the module specifier to be used for importing the jsx and jsxs factory functions when using jsx as "react-jsx" or "react-jsxdev" which...
Read more >Attempted import error 'X' is not exported from | bobbyhadz
To solve the error, make sure the module has a named export and you aren't mixing up named and default exports and imports....
Read more >can't resolve 'react/jsx-runtime' - You.com | The AI Search ...
map((product, index) => { return ( <MenuItem key={index} value={product}> {product} </MenuItem> ); })} </Select> </> ); }; export default App;.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Update on this, it looks like there is an issue with how
@preact/signals-react
incorporates with the JSX runtime. You can circumvent this by updating vite react plugin to use theclassic
jsxRuntime, though I’m unsure what the tradeoffs are there, e.g.:Running into the same issue while building a Vite TypeScript React application.
Edit: @cafreeman - I changed the version to 1.1.1 on my package.json and it has fixed the issue with the build. Although, probably need to take a deeper look to fix in future.