./src/index.js Module not found: Can't resolve 'react-dom/client' in "c:\users\....."

2.6k views Asked by At

Above is the code of the index.js file, below is the error shown in this file

I have tried solving this error in many ways, I have also updated the React and React DOM to version "react": "^18.0.0-rc.0", "react-dom": "^18.0.0-rc.0". I also tried deleting the node modules and re-installing node modules. Waiting for solutions. Also not able to understand these Chokidar errors.

1

There are 1 answers

1
Shlomo H. On BEST ANSWER

Try installing both react and react dom to latest stable v18 builds

npm i react@latest react-dom@latest

Additionally there's an error in your console about files being locked. Did you update the dependencies while the client was still running?