vite icon indicating copy to clipboard operation
vite copied to clipboard

Avoid unnecessary reload after HMR WebSocket connection lost

Open vilicvane opened this issue 3 years ago • 9 comments

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

vilicvane avatar Nov 14 '21 07:11 vilicvane