The requested module 'react-is/index.js' does not provide an export named 'ForwardRef'
See original GitHub issueRecent minor release breaks storybook for react compilation. I think the issue exists in 14.3.3 and 14.3.4 versions and my workaround was to add the following to package.josn:
"resolutions": {
"**/react-element-to-jsx-string": "14.3.2"
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:10 (2 by maintainers)
Top Results From Across the Web
The requested module does not provide an export named ...
This error is referring to node_modules/emotion-theming/dist/emotion-theming.browser.esm.js?v=236b7c74 file. Oh, and btw, @emotion/react is also ...
Read more >The requested module '' does not provide an export named ...
When I try adding my own export in TableCsv.js it says A module cannot have multiple default exports.ts(2528). Here is my code. main.js...
Read more >Requested module does not provide export named 'default'
To solve the error "The requested module does not provide an export named default", use the `default` keyword when exporting a value from...
Read more >module 'react' does not provide an export named 'useRef'
Has anyone run into similar issues and know what you can do to resolve these issues? next.config // next.config.js const withTM = require('next-transpile- ......
Read more >the requested module 'fs' does not provide an export named 'fs ...
js. (Browsers don't have a native fs module.) Use it in your backend node.js application, not the frontend. Since ...
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
This happens because Vite serves
react-is
“as-is” - without transforming it anyhow and Vite relies on native modules in the browser. The “imported” file is this:and as we can see this is just a CJS file.
According to the Vite docs this should be transformed during a “pre-bundle” step: https://vitejs.dev/guide/features.html#npm-dependency-resolving-and-pre-bundling
From my PoV, it looks like an issue with Vite - I’m not familiar with it enough to say what’s exactly broken. The
react-is
is using the very same “structure” of distributed files etc as React itself so this should just be handled in the same way - and I’m unsure why it isn’t in this case. Could you report this to the Vite team? Maybe they would have some pointers regarding this problem.I’m new to Vite, so I’m not sure how this works, but it seems the following helps:
and if you have a look at
node_modules/.vite_opt_cache/react-is.js
it looks like it creates an ESM