Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to run my reactjs Project but I am facing following error Module not found: Error: Can’t resolve ‘react/jsx-runtime’ in ReactJs. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How Module not found: Error: Can’t resolve ‘react/jsx-runtime’ Error Occurs ?
I am trying to run my reactjs Project but I am facing following error.
ERROR in ./node_modules/story1/build/index.es.js
Module not found: Error: Can't resolve 'react/jsx-runtime' in '/Users/ssc/ReactProjects/nfc_app/node_modules/story1/build'
How To Solve Module not found: Error: Can’t resolve ‘react/jsx-runtime’ Error ?
- How To Solve Module not found: Error: Can’t resolve ‘react/jsx-runtime’ Error ?
To Solve Module not found: Error: Can’t resolve ‘react/jsx-runtime’ Error If You are using React 17 then Just Change this following tsconfig: “jsx”: “react-jsx” Now, Your error must be solved. Second solution is You Just need to update react Version to the latest one using this command: npm install –save react@latest Now, Your error should be solved.
- Module not found: Error: Can’t resolve ‘react/jsx-runtime’
To Solve Module not found: Error: Can’t resolve ‘react/jsx-runtime’ Error If You are using React < 17 & Typescript < 4.1.0 then Just Change this following tsconfig: “jsx”: “react” Now, Your error must be solved. Second solution is If You are using React 17 then Just Change this following tsconfig: “jsx”: “react-jsx” Now, Your error must be solved.
Solution 1: For React < 17
If You are using React < 17 & Typescript < 4.1.0 then Just Change this following tsconfig.
"jsx": "react"
Now, Your error must be solved.
Solution 2: For React 17
If You are using React 17 then Just Change this following tsconfig.
"jsx": "react-jsx"
Now, Your error must be solved.
Solution 3: update react version
You Just need to update react Version to the latest one using this command.
npm install --save react@latest
Now, Your error should be solved.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
thank you sooooo… mmuchhh that is solved now