Next.js: Fast Refresh Not Working In 9.4.1

Created on 19 May 2020  路  7Comments  路  Source: vercel/next.js

Bug report

Describe the bug

Fast refresh (hot module replacement) does not work in NextJS 9.4.1.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a new NextJS app (npm init next-app).
  2. Build the app
  3. Run the app (loaded in Chrome 81)
  4. Modify some text in the index.js page.

Expected behavior

The page in the browser is updated to reflect the changes.

Actual behaior

Nothing happens, there is no update. Even on refreshing the page. There is never any HMR related console logs in the browser too.

There are also no new app logs since ready - started server on http://localhost:3000.

System information

  • OS: macOS Catalina 10.15.4
  • Browser (if applies): Chrome 81
  • Version of Next.js: 9.4.1
  • Version of Node.js: 12.16.1
please add a complete reproduction

Most helpful comment

Ok I've just realised my mistake. I'm running the production build, which should not have HMR turned on. So silly. Sorry about this folks!

All 7 comments

Please provide a complete reproduction, just followed the steps to reproduce and it works fine. Note that we also have end to end tests for the exact behavior described.

Yeah sure. What exactly do you need for a complete reproduction?

Are you running this within a docker container or similar?

No, I'm just following the steps on the NextJS web site, as in the reproduction steps above (npm init next-app).

by

  1. Build the app
  2. Run the app (loaded in Chrome 81)

Do you mean you are running

next build && next start

or

next dev

?

Build the app = npm run build
Run the app = npm start

I have not modified the build scripts from their defaults when the app is generated.

Ok I've just realised my mistake. I'm running the production build, which should not have HMR turned on. So silly. Sorry about this folks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lixiaoyan picture lixiaoyan  路  3Comments

formula349 picture formula349  路  3Comments

olifante picture olifante  路  3Comments

jesselee34 picture jesselee34  路  3Comments

kenji4569 picture kenji4569  路  3Comments