Skip to content
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

Module not found: Can't resolve 'react/jsx-runtime' in '...\node_modules\react-dnd\dist\esm\core' #961

Closed
zehawki opened this issue Apr 14, 2021 · 14 comments · Fixed by #965

Comments

@zehawki
Copy link
Contributor

zehawki commented Apr 14, 2021

Describe the bug
Unable to compile with error: Module not found: Can't resolve 'react/jsx-runtime' in '...\node_modules\react-dnd\dist\esm\core'

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade this package to latest (including plugins)
@zehawki zehawki added the bug label Apr 14, 2021
@macrozone
Copy link
Collaborator

delete node_modules
run yarn install or npm install agin

@zehawki
Copy link
Contributor Author

zehawki commented Apr 14, 2021

OK. I'm also updating CRA scripts to 4+ to see if that helps.

@zehawki
Copy link
Contributor Author

zehawki commented Apr 14, 2021

And that has taken me down a different rabbithole facebook/create-react-app#9870

@zehawki
Copy link
Contributor Author

zehawki commented Apr 14, 2021

delete node_modules
run yarn install or npm install agin

Nope. Still same error

@zehawki
Copy link
Contributor Author

zehawki commented Apr 14, 2021

Would this be something on your side? As per this https://stackoverflow.com/questions/65913201/uncaught-error-cannot-find-module-react-jsx-runtime

@zehawki
Copy link
Contributor Author

zehawki commented Apr 14, 2021

Well, solved with this adazzle/react-data-grid#2230 (comment) (I was on version "16.13.1")

@macrozone
Copy link
Collaborator

how did you solve it? i think you should try to upgrade to react 17.x. and latest create-react-app

I did not see the error on my apps (all nextjs)

@zehawki
Copy link
Contributor Author

zehawki commented Apr 15, 2021

By upgrading to react 16.14.0 from 16.13.1, as suggested in that comment I shared (adazzle/react-data-grid#2230 (comment))

@macrozone
Copy link
Collaborator

the problem is as it seems that react-dnd switched to jsx-factory in this release https://github.com/react-dnd/react-dnd/releases/tag/13.0.0

and that seems to require react 16.14.

react-dnd correctly declares react 16.14 as min peer dependency.

We should also bump the min version to 16.14.

i also recommend to try to upgrade to react 17 already. I did not experience any problem with it.

@zehawki
Copy link
Contributor Author

zehawki commented Apr 15, 2021

i also recommend to try to upgrade to react 17 already. I did not experience any problem with it.

A bit afraid to do yet that since I have a really huge project on my side.

macrozone added a commit that referenced this issue Apr 15, 2021
this is because react-dnd requires react 16.14 as min version. It should be usually safe to upgrade react to 16.14 or even 17.

fixes #961
macrozone added a commit that referenced this issue Apr 15, 2021
this is because react-dnd requires react 16.14 as min version. It should be usually safe to upgrade react to 16.14 or even 17.

fixes #961
@macrozone
Copy link
Collaborator

🎉 This issue has been resolved in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@macrozone
Copy link
Collaborator

🎉 This issue has been resolved in version 2.1.0-beta.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Goutham0931
Copy link

Solved in my case.
Giving it as "latest" rather than mentioning version in package,json dependencies
"@emotion/react": "latest",
"@emotion/styled": "latest",
"@material-ui/core": "latest",
"@material-ui/icons": "latest",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants