vite
vite copied to clipboard
Avoid unnecessary reload after HMR WebSocket connection lost
Clear and concise description of the problem
Currently Vite reloads the page after a successful ping after connection lost.
In a hybrid app, once the app launches another app, the connection lost. When the app switches back, the app reloads. To properly debug routines involve switching to another app, we have to either use production build or comment out location.reload()
in vite/dist/client/client.mjs
.
Suggested solution
Reconnect WebSocket to check HMR status instead of reload unconditionally.
Alternative
No response
Additional context
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.