-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Hot reload connection can fail on Windows #27298
Comments
Hi, can you provide more information on your environment? Are there any error messages in the console tab of your browser? Do you have any network configuration or proxying being done that could interfere with a persistent connection being opened to the local Next.js server? |
Visual Studio Code about info: No console messages, neither sucess or failure. Browser config is default, works fine with react/vue reload. No proxy. Also tried to run Chrome on anonymous mode with extensions (ADBlock) off, no changes. Edge was default, since I never really use it. |
@MateusFP95 thanks for the additional info, can you confirm the Next.js version installed by running |
Running But, after I run |
Did you also run |
But |
Interesting thanks for testing that! Glad we've narrowed in on a version, could you try to narrow in on a specific canary it occurred on so we can try to figure out which change caused this to not work? There are 12 canaries between I'm not able to reproduce this on a Windows 10 Pro laptop I have access to so it may be specific to certain Windows versions 🤔 |
Test result below on
Versions
@ijjk I don't think it's related to certain windows build, as create-react-app works totally fine for me, umi.js (which uses @pmmmwh/react-refresh-webpack-plugin, see here) also works fine. |
@shadowwalker yeah it sounds like this may be related to #20409 |
@shadowwalker @MateusFP95 could you please confirm this is the issue by testing a patch that reverts that PR's host change by running |
@ijjk Confirm the patch fix the issue, fast refresh works as expected after apply the patch |
This fixes a case where the HMR connection for fast refresh would fail to connect on Windows due to a change being made to the default host being listened to. Previously we didn't set a default for the `host` value when calling `server.listen` which allowed the default listening behavior to be used although in #20409 a default of `0.0.0.0` was added which causes conflicts for some set-ups mainlly on Windows it seems. ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added (N/A) - [x] Errors have helpful link attached, see `contributing.md` Fixes: #27298 Fixes: #27254 Fixes: #4456 (comment) Fixes: #20409 (comment) x-ref: #20409
This has been updated in |
This fixes a case where the HMR connection for fast refresh would fail to connect on Windows due to a change being made to the default host being listened to. Previously we didn't set a default for the `host` value when calling `server.listen` which allowed the default listening behavior to be used although in vercel#20409 a default of `0.0.0.0` was added which causes conflicts for some set-ups mainlly on Windows it seems. ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added (N/A) - [x] Errors have helpful link attached, see `contributing.md` Fixes: vercel#27298 Fixes: vercel#27254 Fixes: vercel#4456 (comment) Fixes: vercel#20409 (comment) x-ref: vercel#20409
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
11.0.1
What version of Node.js are you using?
v14.17.0
What browser are you using?
Edge 91.0.864.67 - Chrome 91.0.4472.124
What operating system are you using?
Windows 10 Pro 20H2
How are you deploying your application?
npm run dev
Describe the Bug
Hot reload / Fast Refresh isn't working.
I'm following the next tutorial, so here's my code:
npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter"
Here https://nextjs.org/learn/basics/create-nextjs-app/editing-the-page it says that the page will live reload, just like react / vue, but it doenst reload.
On network tab I see this errors:
Approaches tried following google/yt tutorials:
Create next.config.js with FAST_REFRESH='TRUE'
Create webpack.config.js with TARGET = 'WEB'
Delete project and restarted from 0
npm ci
Delete node_modules and .next and recreated
Expected Behavior
Live reload should work.
To Reproduce
npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter"
The text was updated successfully, but these errors were encountered: