-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
server.hmr = false should disable server ping #8020
Comments
Is this a duplicate of #2345? |
I missed that one! It's not quite a dupe, but it would help: the fix for that bug (proposed in the #6819 PR) would still leave vite pinging an unconfigurable hmr url with This bug strikes me as still valid in principle: if the way to disable hmr is I'm not sure there's another bug that exactly covers this, but there's a bunch of bugs all in this general cluster, so I'm fine with closing this if it's easier to track elsewhere. |
Do you want to disable pings to vite server? If so, why do you want to do that? |
Closing as the original issue is solved by #6819. |
Describe the bug
When HMR is disabled with
server.hmr = false
, client.ts still opens a websocket to the server, and then runsawait fetch(`${base}__vite_ping`)
once per second if the socket is closed.This is a problem in backend integration settings (e.g. Django) because the default value for
${base}
points to the backend server rather than the vite server, and there is no way to configure the value with hmr disabled.This means if the socket is closed, Vite ends up pinging the backend server until refresh, with no way to configure what url is being pinged. This ends up polluting the backend dev server log with continual 404s and interfering with development.
There are some previous related bugs about disabling HMR and/or server ping: #1729 #1989 #5228 #5763. I'm filing this one separately to document the issue that
server.hmr = false
ends up pinging an unrelated server in backend integrations and can't be configured. Havingserver.hmr = false
disable ping seems like a promising fix.Reproduction
na
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: