1

I installed react app through create-react-app recently. So when I changed any file in app, it doesn't reload in browser. But when I changed something in index.html it auto-refresh. Can anyone help me with this issue?

Shankar Nanda
  • 129
  • 4
  • 11
  • I was facing the same issue, then I deleted the ```node-modules``` folder, reinstalled all the dependencies with ```yarn``` instead of ```npm```. this fixed my prob – Ketan Ramteke Nov 18 '20 at 15:15
  • Does this answer your question? [Development server of create-react-app does not auto refresh](https://stackoverflow.com/questions/43274925/development-server-of-create-react-app-does-not-auto-refresh) – brc-dd Nov 19 '20 at 07:22
  • Webpack watcher bug is not applied for me bcz...I don't have my index.js file inside subfolder – Shankar Nanda Nov 19 '20 at 07:44

3 Answers3

0

I faced this same issue. Just delete the node_nodules and then run npm install. That should fix it. If this doesn't solve your problem, then just create another project with create-react-app.

You can follow this link Development server of create-react-app does not auto refresh

Pranta
  • 2,928
  • 7
  • 24
  • 37
  • I did both process of deleting node-modules and again installing it, and finally created completely new project with create-react-app. Still the problem is there. – Shankar Nanda Nov 19 '20 at 07:15
  • @ShankarNanda check out the link. That should fix it – Pranta Nov 19 '20 at 07:19
  • My App Component or index.js file is not inside any subfolder. So am not sure Webpack watcher bug is applied for me – Shankar Nanda Nov 19 '20 at 07:43
  • @ShankarNanda If none of this works for you, then I suggest creating a bug with create-react-app in github or just leave your problem here: https://github.com/facebook/create-react-app/issues/659 – Pranta Nov 19 '20 at 07:48
  • @ShankarNanda did you ever solve your problem? How? I am having the same issue. I have the index.js file in the src subfolder and the issue appears when I placed the App.js file also in the subfolder and compnentes in the ./src/pages/profile and in the ./src/components subfolder, it doesn't recompile when I change the ones in the ./src/pages/profile subfolder, forcing me to change something in the other files for it to reocmpile. Very awkward bug, until I figured out the source of the behavior. Something is clearly broken. By the way, using Ubuntu 20.04.02 and VSC 1.59.1 Nodejs 14.16 – Julio Spinelli Sep 02 '21 at 13:08
0

I had your problem. problem was from my index.html . I added the font awesome CDN outside of head tag. in my idea go and check the index.html . that was all for me, hope work for you.

0

you need to clear the .cache folder in node-modules and then run npm-restart this works for me everytime like a charm.

pndey
  • 71
  • 4