Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast Refresh does not work @latest #35703

Closed
1 task done
kasperaamodt opened this issue Mar 29, 2022 · 14 comments · Fixed by #35718
Closed
1 task done

Fast Refresh does not work @latest #35703

kasperaamodt opened this issue Mar 29, 2022 · 14 comments · Fixed by #35718
Assignees
Labels
Webpack Related to Webpack with Next.js.

Comments

@kasperaamodt
Copy link
Contributor

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101
Binaries:
  Node: 17.5.0
  npm: 8.4.1
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 12.1.2
  react: 18.0.0
  react-dom: 18.0.0

warn - Latest canary version not detected, detected: "12.1.2", newest: "12.1.3-canary.0".
Please try the latest canary version (npm install next@canary) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue

What browser are you using? (if relevant)

Chrome 99.0.4844.83 (Official Build) (arm64)

How are you deploying your application? (if relevant)

No response

Describe the Bug

Just installed a new project with npx create-next-app@latest, and fast refresh is not working.

Expected Behavior

For the browser to refresh when I save a change in my code editor.

To Reproduce

npx create-next-app@latest

start project with npm run dev

@kasperaamodt kasperaamodt added the bug Issue was opened via the bug report template. label Mar 29, 2022
@kasperaamodt
Copy link
Contributor Author

Updated to Chrome Version 100.0.4896.60 (Official Build) (arm64), still same issue.

@kasperaamodt kasperaamodt changed the title Fast Refresh not working Fast Refresh really slow Mar 29, 2022
@kasperaamodt
Copy link
Contributor Author

Correction on my ticket. It appears the fast refresh is working, it's just taking a long time for it to actually reload. I measured it to about 4 seconds.

@ghocevar
Copy link

I have the same problem only that Fast Refresh doesn't work at all. Apparently React v18 breaks it, as it works with the latest version of React v17 (tried with Next.js v12.1.3-canary and v12.1.1).

@gleno
Copy link

gleno commented Mar 29, 2022

I think the original title said it best. Mine is completely broken for changes made in the code, and works fine for changes made in stylesheets. Also brand new app, tried both with --typescript flag and without.

@lordkerwin
Copy link

I have the same issue, kind of.
Brand new nextjs app, with/without typescript, created using npx create-next-app@latest and i can see in the terminal that it's reloading.

event - compiled client and server successfully in 107 ms (142 modules)

and in the browser (chrome, firefox and brave) I see the little vercel loader in the bottom right for a fraction of a second... however, the page doesn't refresh.

Like i said, brand new next app, and all i have changed is the word Welcome to Hello and i have to actually go and F5 or refresh the page to see changes.

Forgot to mention, latest LTS node, running on Pop!_OS.

@kasperaamodt kasperaamodt changed the title Fast Refresh really slow Fast Refresh does not work @latest Mar 29, 2022
@kasperaamodt
Copy link
Contributor Author

I found out that I had a component that made my website refresh every 4 seconds, so when I removed that component, the fast refresh does not work at all.

@CarlosLevir
Copy link

Same thing here.

@bryanbarrios
Copy link

bryanbarrios commented Mar 30, 2022

Same problem here. I'm using the latest version on an ARM.

@djxy
Copy link

djxy commented Mar 30, 2022

For those who have this issue. You need to downgrade the react version to 17.0.2 for react and react-dom.

The latest React version changed in the last day, from 17.0.2 to 18.0.0.

@caestrada
Copy link

@djxy that was it!

@ijjk ijjk added kind: bug Webpack Related to Webpack with Next.js. and removed bug Issue was opened via the bug report template. labels Mar 30, 2022
@diegohaz
Copy link

Fast Refresh also stopped working for me. The page only gets updated when I interact with an element with an internal state (and the state changes).

@timneutkens timneutkens self-assigned this Mar 30, 2022
@timneutkens
Copy link
Member

timneutkens commented Mar 30, 2022

Figured out the problem and opened a PR here: #35718 We'll get it out today 🙏

@kodiakhq kodiakhq bot closed this as completed in #35718 Mar 30, 2022
kodiakhq bot pushed a commit that referenced this issue Mar 30, 2022
- Updates the React 18 test suite to the latest React version.
- Upgrade `react-refresh` module

Fixes #35518
Fixes #35703

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: Jiachi Liu <[email protected]>
@timneutkens
Copy link
Member

Released in 12.1.3

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Webpack Related to Webpack with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.