react-hook-form: issue: Can't import the named export 'Fragment' from non EcmaScript module (only default export is available)
Version Number
7.44.2
Codesandbox/Expo snack
Steps to reproduce
When I want to build my app on CRA. I got an error
Creating an optimized production build... Failed to compile. ./node_modules/react-hook-form/dist/index.esm.mjs Can't import the named export 'Fragment' from non EcmaScript module (only default export is available)
Expected behaviour
Build
What browsers are you seeing the problem on?
No response
Relevant log output
No response
Code of Conduct
- I agree to follow this project’s Code of Conduct
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 11
- Comments: 40 (14 by maintainers)
Commits related to this issue
- close #10465 issue with build issue with fragment — committed to react-hook-form/react-hook-form by bluebill1049 a year ago
- fix: add react to external deps Closes: #10465 (maybe lol) — committed to react-hook-form/react-hook-form by Moshyfawn a year ago
- fix: add react to external deps Closes: #10465 (maybe lol) — committed to react-hook-form/react-hook-form by Moshyfawn a year ago
- fix: add named component export Closes: #10465 — committed to react-hook-form/react-hook-form by Moshyfawn a year ago
- 🦉 fix: add named component export (#10486) Closes: #10465 — committed to react-hook-form/react-hook-form by Moshyfawn a year ago
Sorry, can’t repro the issue, hence can’t test the rc version 😔
I downgraded for now and the problem is solved, but it needs to be fixed.
Currently using : “react-hook-form”: “7.43.9”,
Appears to be fixed👍
Alright, ya’all, the new v7.44.3 release should fix the issue. Try it and report if there’s an issue
FYI our react-scripts has always been pinned to 4.0.3 and this problem just started. I pinned react-hook-form to 7.43.1 and the build works now.
So, it’s gotta be something to do with the new
Formcomponent & how it relies on the React API.v7.44.0-next.0 breaks, v7.43.9 doesn’t
K, so, I was able to reproduce the issue. Here’s a repository and it is reproducible when running the
startcommand. Here’s a codesandbox with the reproductionCould someone test the RC version and see which one breaks? it could be a deps update.
I’m using version 17.0.2 of React. And here are the other dependencies
Removing the “^” worked for me. For those of you who don’t read the thread the dev working on this has not been able to find the root cause.
I started experiencing this issue 2 days ago after the release of React-Hooks-forms 7.44.2. I would assume that all versions before that are fine to use.
Original “react-hook-form”: “^7.24.1”
New “react-hook-form”: “7.24.1”
I am using “react-hook-form”: “7.22.3”,
I am also facing the same issue, could anyone please suggest which version should we use or any workaround for it
same problem with 7.44.2, lower version is fine