-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
HMR is not completely disabled #13994
Comments
So Vite shouldn't disable websocket even if Maybe you can transform the |
I'm very sorry, I didn't notice that this issue had already been mentioned, after looking at #9007 ,I tried to work around it by customizing hmr.server, which seems to be working so far. |
I'll close this issue then 👍 |
Describe the bug
For some specific reason, I had to start the project using Vite in the production environment. At this point, I set
config.server.hmr
tofalse
in an attempt to avoid unnecessary overhead in the production environment. However, I found that when set to false, the page still creates websocket requests and sends ping messages periodically. However, when the server firewall does not open the default port24678
, the Websocket fails to connect, which triggers a shutdown event and causes the page to auto-refresh over and over again. The Websocket connection seemed useless whenconfig.server.hmr
was set tofalse
, so I made some changes to avoid creating a Websocket connection in this case.Reproduction
https://github.com/MarryDream/vite-hmr-demo
Steps to reproduce
Please deploy to a production server for testing,allow port
11451
on the firewall and accesshttp://ip:11451
. But do not allow port24678
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: