Vite keeps refreshing the page with logs stuck in `connecting`
See original GitHub issueDescribe the bug
Vite keeps refreshing the page and logs are stuck with
connecting...
server connection lost. polling for restart...
Reproduction
Here is the codesandbox of the official react template package. This one is stuck while I was trying (image above).
System Info
System:
OS: Windows 10 10.0.19043
CPU: (8) x64 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
Memory: 7.89 GB / 15.85 GB
Binaries:
Node: 16.1.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - C:\Users\Prince~1\AppData\Roaming\npm\yarn.CMD
npm: 7.11.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 92.0.4515.107
Edge: Spartan (44.19041.1023.0), Chromium (92.0.902.62)
Internet Explorer: 11.0.19041.1
Used Package Manager
npm
Logs
[vite] connecting...
[vite] server connection lost. polling for restart...
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Troubleshooting - Vite
If you are running Vite with WSL2, Vite cannot watch file changes in some conditions. See server.watch option. A full reload happens instead...
Read more >javascript - Vite - React - App keeps refreshing with log: Server ...
Issue : Suddenly app keeps refreshing indefinitely giving this log in console: server connection lost polling for restart.
Read more >How to Fix the 504 Gateway Timeout Error on Your Site - Kinsta
One of the first things you can try when encountering a 504 Gateway Timeout error is to wait a few minutes and try...
Read more >Troubleshooting - Gitpod
These logs contain information about the workspace, the session, and the Visual Studio Code environment. They are useful for diagnosing connection issues ...
Read more >Errors – Vercel Docs
Via the CLI, Logs or dashboard, follow the link, if available, in the description of the error. If not, search for the error...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I’ve managed to resolve it for myself. I’ve had to define host where vite is running, because by default it’s taken from
window.location.hostname
, so that’s why it never connects.thanks!
clientPort
did the trick for me.