Cannot find module 'react/jsx-runtime'
See original GitHub issueCurrent behavior:
I’ve upgraded to v11, I received the following error when the run the test suite.
● Test suite failed to run
Cannot find module 'react/jsx-runtime' from 'node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.dev.js'
Require stack:
node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.dev.js
node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js
packages/react-ui/src/utils/test-utils.js
jest.setup.js
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
at Object.<anonymous> (node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.dev.js:14:23)
My babel file:
module.exports = {
env: {
test: {
presets: [
[
"@babel/preset-env",
{
targets: {
node: "current",
},
},
],
[
"@babel/preset-react",
{
runtime: "automatic",
importSource: "@emotion/react",
},
],
],
plugins: ["@emotion/babel-plugin"],
},
},
};
Environment information:
react
version: 17.0.1@emotion/react
version: 11.0.0@emotion/jest
version: 11.1.0@emotion/babel-plugin
version: 11.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (2 by maintainers)
Top Results From Across the Web
Uncaught Error: Cannot find module 'react/jsx-runtime'
This solution resolved my issue. I found it over here. 👇️ with NPM. npm install react@latest react-dom@latest ...
Read more >cannot find module '@emotion/react/jsx-runtime' or its ...
If you're still getting the "Cannot find module 'react/jsx-runtime' or its corresponding type declarations" error, open your package.json file and make sure ......
Read more >jsx-runtime - npm
Runtime does not renders JSX-IR, otherwise it provides common interfaces for Renderer to be implemented. Installation. npm install jsx-runtime ...
Read more >[Solved]-Uncaught Error: Cannot find module 'react/jsx-runtime'
[Solved]-Uncaught Error: Cannot find module 'react/jsx-runtime'-Reactjs ... So my setup actually was working. There was somehow a glitch in the symlink. I as...
Read more >react-dnd 16.0.0 and DnDProvider.js : r/reactjs - Reddit
ERROR in ./node_modules/react-dnd/dist/core/DndProvider.js 39:0-48 Module not found: Error: Can't resolve 'react/jsx-runtime' in 'C:\mcdev\react ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As of now, this fixes it for me…
yarn add @types/react
or
npm install @types/react
I generated a new
lock
file and works fine, thanks for the help!