-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
[CRA v4] Can't import the named export 'cloneElement' from non EcmaScript module. PLEASE UPGRADE YOUR CRA VERSION 😿 #775
Comments
Exact same issue for me. |
I'm on it |
@Robloche you are using latest CRA? |
@cakonze, @niwa-takeru, @thib3113, just tested with the latest CRA and it works as expected. I suggest you upgrade to the latest CRA. 4.0.1 is almost 2 years old |
@fkhadra not so easy ... CRA 5 use webpack 5, which remove node js polyfill ; And lot of people can't migrate to it : facebook/create-react-app#11756 . About my personal case, I'm actually migrating to V5, but it will took a long time (because I need to rewrite/re publish some libraries that use polyfill) |
@thib3113 I want to 😭. The module system in our ecosystem is so messy. If I revert the PR then I would break vitejs and nextjs. I don't see any good solution I understand your pain, believe me. What I can suggest is to stick to v9.0.3 until you fully migrated to CRA v5.
|
I've also found this solution, for those who cannot migrate to v5 reactioncommerce/reaction-component-library#399 (comment) |
@fkhadra thank you, but it's not really a solution with react-scripts . It's a solution to doesn't use it :) . ( but, my case is "pretty" easy, I'm just using an old library, that is preparing a big major update ... and so doesn't update the last one ... I will start by trying to fix it, and do a PR, before switching to another things ) About the change, the main problem for me is maybe the version change ... patch need to doesn't contains breaking changes and only bugfixes . ( but in fact |
Unfortunately, no. I would like to but I've got troubles with a couple of npm packages that weren't designed to be used in a browser but were supported until CRA 4. |
@thib3113 regarding semver, this is debatable. There are no breaking changes introduced in the library itself. The main issue is that CRA v4 does not support es module. But as I said, this is debatable, so as a consumer of the package, I understand your point of view as well. The current JS ecosystem is moving to es modules, there is a lot of friction but, passed that point, I believe that the ecosystem will get better. As a maintainer, we are the driving force of this change. Anyway, I digress. I'll check with other maintainers about how they handled this change. Sorry for the trouble 🙏 |
This solution works for me! Thanks! |
also getting this |
Not the best fix at the moment, but I opted to replace the version I was using with a minor one. |
@Joshua-Enrico it works with |
Same here |
having the same isuue |
same problem |
having the same isuue |
same issue. Thanks @fkhadra for solution. |
Still the same issue in |
I got this error using 9.0.5. I went down to 9.0.3 and now it works. |
Hello, |
Hey @Robloche, I understand your concern but supporting something that's 2 years old + modern bundlers is a lot of work. Can't you upgrade CRA? As a maintainer, we are supposed to drive the changes to the modern module system but we also need your help with that. |
Yes, I totally want to upgrade to CRA5 but this leads to other issues (missing polyfills, as you're obviously aware)? So, for now, I'll stick to CRA4 and react-toastify 9.0.3. I just wanted to know if something was in progress regarding this issue, but I truly understand that's not a trivial dev. Thanks! |
It would be nice if it is not a requirement and expectation to upgrade to react CRA 5. This time I can safely say most of the sites have not been upgraded due to the breaking change. I really like this plugin. |
i had this error => "Can't import the named export 'cloneElement' from non EcmaScript module" |
My issue is solved by update the react-script and node version. |
thanks |
same issue
|
It work for me, Thanks |
Me too!!! |
Also I got this issue. ./node_modules/react-toastify/dist/react-toastify.esm.mjs |
The some issue |
Hi, I am having this issue in a non CRA boilerplate but in a project with just storybook and webpack, probably same scenario as @The-Code-Monkey
what exactly in CRA5 makes the system work? I am looking to manually upgrade the necessary dependency but slightly unsure on where the break is here |
@cpvalente Try different versions of Edit: That would also mean that the problems is not in CRA, but rather in |
For me this fixed storybook storybookjs/storybook#16690 (comment) |
I will close the issue here . If you got this error, you can : But, CRA 5 / webpack 5 stop including nodejs polyfills by defaults So, if you got errors with storybook, or any other error related, you need to add them manually ( you can find more informations on the CRA repository, or on the web ) . About the why it works with 9.0.3 and not with 9.0.4, it's writted in the release note of the 9.0.4 |
cool, I fixed the version of react-toastify to 9.0.3 when working on project SP Extensions |
Same here. So it's time to switch to vite ? ahah |
@Snouzy either you upgrade CRA or you switch to vite. I'd like to remind that CRA v4 is more than 2 years old. |
Yup ahah, i will ! |
I pinned to version 9.0.3 due to this issue: fkhadra/react-toastify#775
…397) See https://reportedcab.slack.com/archives/C9VNM3DL4/p1672888880155269: > What do you think of replacing the react modals with alerts? instead > of dismissing the popup it would be some text that disappears after a > few seconds I pinned to react-toastify version 9.0.3 due to this issue: fkhadra/react-toastify#775 See here for a demo of react-toastify: https://fkhadra.github.io/react-toastify/introduction Example images: mobile alert/warning: ![image](https://user-images.githubusercontent.com/6473925/214184085-a2120937-cab5-4475-897e-334109dac988.png) desktop alert/warning: ![image](https://user-images.githubusercontent.com/6473925/214182462-7a625d22-e123-4c43-8557-d0f1270d79ff.png) <img width="781" alt="image" src="https://user-images.githubusercontent.com/6473925/214182868-e357a837-f361-4ab5-a9db-4389ec305fa9.png"> desktop success: ![image](https://user-images.githubusercontent.com/6473925/214182509-c6f5e379-c713-4686-87d2-e1c67272e253.png)
still an issue with ^9.1.1 |
@jessewriter this issue will not be fixed : #775 (comment) |
Still facing the same issue in node v22.1.0. there error is "133.0 ./node_modules/react-toastify/dist/react-toastify.esm.mjs |
Do you want to request a feature or report a bug?
A Bug
What is the current behavior?
v9.0.4 seems to add a breaking change .
My setup works with V9.0.3, but when updating to V9.0.4 react scripts refuse to build
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 17.0.1
react-scripts 4.0.1 ( with typescript )
The text was updated successfully, but these errors were encountered: