Next.js Discord

Discord Forum

Hot reloading doesn't work

Unanswered
New Guinea Freshwater Crocodile posted this in #help-forum
Open in Discord
New Guinea Freshwater CrocodileOP
When I make changes, e.g. some trivial change to a CSS file, and reload my local dev page at http://localhost:3000, it sometimes is missing the new change. This server is run with npx next dev. Reloading doesn't help, and disabling the browser cache doesn't help. In the output from npx next dev, it shows that my changes to files are forcing recompilations, and I can see that the files are saved in their updated form, but for some reason my site just isn't always picking up the change. Any ideas what's going on? I'm on macOS.

3 Replies

@New Guinea Freshwater Crocodile When I make changes, e.g. some trivial change to a CSS file, and reload my local dev page at http://localhost:3000, it sometimes is missing the new change. This server is run with `npx next dev`. Reloading doesn't help, and disabling the browser cache doesn't help. In the output from `npx next dev`, it shows that my changes to files are forcing recompilations, and I can see that the files are saved in their updated form, but for some reason my site just isn't always picking up the change. Any ideas what's going on? I'm on macOS.
this is almost always the .next folder cache getting stale. even though the terminal shows recompilation, the cached output it serves can fall out of sync. stop the dev server, delete the .next folder, and start it again. if it keeps coming back check your next version, some newer ones have a persistent file cache that causes this. you can disable it with cacheMaxMemorySize: 0 in the experimental key of your next config.
New Guinea Freshwater CrocodileOP
Had to downgrade to next 14 🙁 ah well
whats your nodejs version? im in macos and ive never had this problem