Skip to content
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

fix(client): overlay not appearing when multiple vite clients were loaded #18647

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
apply review
  • Loading branch information
seokju-na committed Nov 21, 2024
commit df14baa87cca9c983bb4033f98000ea458c3d86f
10 changes: 3 additions & 7 deletions packages/vite/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,12 @@ const enableOverlay = __HMR_ENABLE_OVERLAY__
const hasDocument = 'document' in globalThis

function createErrorOverlay(err: ErrorPayload['err']) {
clearErrorOverlay()
const { customElements } = globalThis
let ErrorOverlayConstructor
if (customElements) {
ErrorOverlayConstructor = customElements.get(overlayId)
}
if (!ErrorOverlayConstructor) {
ErrorOverlayConstructor = ErrorOverlay
const ErrorOverlayConstructor = customElements.get(overlayId)!
document.body.appendChild(new ErrorOverlayConstructor(err))
}
clearErrorOverlay()
document.body.appendChild(new ErrorOverlayConstructor(err))
}

function clearErrorOverlay() {
Expand Down