-
Notifications
You must be signed in to change notification settings - Fork 81
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
The requested module 'react-is/index.js' does not provide an export named 'ForwardRef' #662
Comments
Thanks for reporting that, I will have a look today (ping @Andarist) |
I'm not sure of what happens here. The Can you check that you have the |
Everything seems to works in CRA env: https://codesandbox.io/s/clever-haze-tx9di?file=/src/App.js |
@malekpour could you provide a repro case? |
I just create a repo to reproduce the error. Instead of CRA I am using vite. I can confirm https://github.com/malekpour/vite-react-element-to-jsx-string |
I'm having the same error, started from scratch creating a new React Vite project @malekpour |
+1 on this, new vite react app with storybook + storybook-builder-vite, for anyone doing the yarn berry or canary dance you want the following in your config and then run yarn again to do the resolution step. Thanks, @malekpour for the workaround! |
I'm sorry but I did not have the time theses days to have a look on this. If someone have hints or want to make a PR I will try to help/review it quickly as I can. |
This happens because Vite serves 'use strict';
if ("development" === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
} else {
module.exports = require('./cjs/react-is.development.js');
} 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 |
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
|
Recent 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:
The text was updated successfully, but these errors were encountered: