You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
notice that you get an hmr overlay in first tab showing the error
open the app in a second tab; you just get a white screen, until you hit refresh in the first tab, now you will see the hmr overlay in the second tab but not the first
Note that sometimes this doesn't happen, but 2 or 3 attempts of the above tab opening steps above should reproduce it. It's also possible to trigger it with two open tabs in the error state and refreshing one repeatedly; sometimes on refresh you get a white screen and the hmr error is not sent on the websocket until the other tab is refreshed.
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 vuejs/core instead.
bufferedError is set to null on a new connection, but that races with the code that sets bufferedError when sending the payload. At the time it sends out the error, there's typically only one of the clients connected. This comment
// On page reloads, if a file fails to compile and returns 500, the server
// sends the error payload before the client connection is established.
// If we have no open clients, buffer the error and send it to the next
// connected client.
letbufferedError: ErrorPayload|null=null
Seems to suggest it was intentional, given the singular "client". This was introduced in 23016ca, and I don't see any indication of exactly why we need to set bufferedError to null there.
I'm going to look into whether or not there's a better place for clearing out the buffered error, specifically when we know we've transitioned from an error state to a non-error state.
Describe the bug
This error is possible to reproduce on a brand new vite app.
Steps.
npm create vite@latest
npm run dev
counter.ts
Note that sometimes this doesn't happen, but 2 or 3 attempts of the above tab opening steps above should reproduce it. It's also possible to trigger it with two open tabs in the error state and refreshing one repeatedly; sometimes on refresh you get a white screen and the hmr error is not sent on the websocket until the other tab is refreshed.
Reproduction
https://vite.new/
Steps to reproduce
detailed in the above description
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: