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: Error: Can't resolve 'react/jsx-runtime' #18

Closed
Soulfull opened this issue Feb 17, 2022 · 4 comments
Closed

Module not found: Error: Can't resolve 'react/jsx-runtime' #18

Soulfull opened this issue Feb 17, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Soulfull
Copy link

Describe the bug
Importing effector-react-slots in create-react-app v5.0.0 project.
After npm run start getting an error

ERROR in ./node_modules/effector-react-slots/dist/module.js 2:0-83
Module not found: Error: Can't resolve 'react/jsx-runtime' in '/Users/soulfull/dev/product-guide/node_modules/effector-react-slots/dist'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

Environment info
current version of create-react-app: 5.0.0
node - 16.13.0
npm -8.1.0

@Soulfull
Copy link
Author

Soulfull commented Feb 17, 2022

Is it possible to remove "type": "module" from package.json?
I forked repo and test without type: module. The error is gone.

Additionally, I got an error on npm run build

🚨 Build failed.

@parcel/core: The plugin "@parcel/transformer-typescript-types" is not compatible with the current
version of Parcel. Requires "^2.3.1" but the current version is "2.2.1".

So, I had to update parcel version.

@Soulfull Soulfull added the question Further information is requested label Feb 17, 2022
@Soulfull Soulfull changed the title Bug: Module not found: Error: Can't resolve 'react/jsx-runtime' Module not found: Error: Can't resolve 'react/jsx-runtime' Feb 17, 2022
@binjospookie binjospookie added bug Something isn't working and removed question Further information is requested labels Feb 17, 2022
@binjospookie
Copy link
Collaborator

@binjospookie
Copy link
Collaborator

Try to use smth like this for testing

@Soulfull
Copy link
Author

It seems that this bug does not isolated in CRA. Waiting for react v18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants