Closed thib3113 closed 1 year ago
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 : https://github.com/facebook/create-react-app/issues/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.
Edit: I'll update the release note to mention the issue with CRA v4
I've also found this solution, for those who cannot migrate to v5 https://github.com/reactioncommerce/reaction-component-library/issues/399#issuecomment-467860022
@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 ^9.0.1
will match 9.1.0
too ... ) .
@Robloche you are using latest CRA?
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 🙏
I've also found this solution, for those who cannot migrate to v5 reactioncommerce/reaction-component-library#399 (comment)
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. "react-toastify": "^9.0.1" > "react-toastify": "9.0.0",
@Joshua-Enrico it works with 9.0.3
too . only the 9.0.4
introduce this change
Same here 9.0.3
seems to work fine though.
having the same isuue
same problem
having the same isuue
same issue. Thanks @fkhadra for solution.
Still the same issue in 9.0.5
Not the best fix at the moment, but I opted to replace the version I was using with a minor one. "react-toastify": "^9.0.1" > "react-toastify": "9.0.0",
I got this error using 9.0.5. I went down to 9.0.3 and now it works.
Hello, Can we get an update on this issue, please? Not a real blocker since we can stick to v9.0.3 but we're slowly drifting away from the latest version...
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. If you want to stick with CRA v4 there is this workaround https://github.com/reactioncommerce/reaction-component-library/issues/399#issuecomment-467860022
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. And as soon as my workload allows it, I'll upgrade everything.
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" i had tried many other ways but coudnt find a solution at last i updated the react-script version 2.0.3 to 5.0.1 and i corrected the issue.
i am having same issue @fkhadra
./node_modules/react-toastify/dist/react-toastify.esm.mjs Can't import the named export 'cloneElement' from non EcmaScript module (only default export is available)
please help @fkhadra
Im getting this issue using the latest version of storybook and react, and its actually crashing my storybook.
I'm seeing this issue with CRA5 and >=v9.0.4
@The-Code-Monkey Any repo to share?
@Davenporten I've created a project with CRA5 and it worked as expected. Are you sure, you are using the right react-scripts version ?
I've been trying out the react-app-rewired
solution and am waiting for things to compile/index. I will revert back in just a little to confirm. Thanks for the quick response!
I'll try tomorrow with the rewired solution and keep you posted
i have the same issue and i have used create-react-app my react-toastify version is ^9.0.8. please help me Here is the full message: ./node_modules/react-toastify/dist/react-toastify.esm.mjs Can't import the named export 'cloneElement' from non EcmaScript module (only default export is available)
me to same issue just updated to ^9.0.8 from ^7.0.4
My issue is solved by update the react-script and node version.
thanks
same issue
"react-toastify": "^9.0.8"
"react-scripts": "^4.0.3"
"react": "^18.2.0"
"react-dom": "^18.2.0"
Not the best fix at the moment, but I opted to replace the version I was using with a minor one. "react-toastify": "^9.0.1" > "react-toastify": "9.0.0",
It work for me, Thanks
Not the best fix at the moment, but I opted to replace the version I was using with a minor one. "react-toastify": "^9.0.1" > "react-toastify": "9.0.0",
I got this error using 9.0.5. I went down to 9.0.3 and now it works.
Me too!!!
Also I got this issue.
./node_modules/react-toastify/dist/react-toastify.esm.mjs Can't import the named export 'cloneElement' from non EcmaScript module (only default export is available)
The some issue ./node_modules/react-toastify/dist/react-toastify.esm.mjs Can't import the named export 'cloneElement' from non EcmaScript module (only default export is available)
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
"@storybook/react": "^6.5.12",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
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
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
"@storybook/react": "^6.5.12", "webpack": "^4.41.5", "webpack-cli": "^3.3.10"
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 webpack
, I honestly doubt the issue is anywhere else
Edit: That would also mean that the problems is not in CRA, but rather in webpack
. I don't know if it matters to anyone though since the maintainers said they wouldn't be supporting older versions of bundlers!
For me this fixed storybook https://github.com/storybookjs/storybook/issues/16690#issuecomment-971579785
I will close the issue here .
If you got this error, you can : -> fix the version of react-toastify to 9.0.3 -> upgrade to CRA 5 / webpack 5
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 ! thanks buddy :)
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 )