Module not found: Error: Can't resolve 'react-dom/client' SOLVED in React JS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone in this video I'll be showing you how  to solve the error module not found error can't   resolve react Dom client in your react project  file so let me explain you what I did to get this   error and I'll be also showing you a solution  for this so I was basically trying to downgrade   my react version from 18 which is the latest  version to 17. so what I did was I just went to my   package.json file, changed the react and react Dom  version to 17.0.2 and I just then deleted my node   modules and I then run the command npm install and  I am trying to run my react project Again by the   command npm start and at that time I am getting  this error so in order to solve this first thing   what you need to do is you need to go to your  index.js file which is present inside source   all right so just go to source and here you'll be  having this index.js file click that and this is   the spot where we are having this react Dom Client  all right so the client thing so if you are going   to use react version 17 just remove this client  thing all right so now let me just now save this   Ctrl s and now you will be getting another error  even though it shows here compiled successfully if   I go to my browser nothing will be there and if I  go to my console so I will just click Ctrl shift I   so you'll be getting this uncaught type error  so for solving this error just go to the same   index.js file and here you will be having this  const root react dom thing basically this chunk   of code and you need to replace that particular  code with this thing all right so let me just now   zoom in if you can't view it let me just zoom it  to the max so this is the thing what you need to   replace the existing code with so just copy this  you can just pass and type it out and you need   to just replace this with this all right yeah  pretty much similar I think you need to just   add this thing this will be already there and  we'll just put a comma and include this thing   alright not so much of changes and now just  save this if I go and here you can see this   time we'll be getting our output and no errors in  the console which means that we have successfully   downgraded to react 17 and it's working fine so  that's it guys I hope you have found this video   useful do check the playlist of my channel I've  have done many tutorials in C C++ Java python   node.js mongodb MySQL springboot CRUD operations  check them out subscribe me thanks for watching
Info
Channel: United Top Tech
Views: 14,964
Rating: undefined out of 5
Keywords: Module not found: Error: Can't resolve 'react-dom/client', React js error solved, module not found error in react js
Id: rjv9KpaG2io
Channel Id: undefined
Length: 2min 47sec (167 seconds)
Published: Wed Jul 19 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.