Skip to content

Commit

Permalink
fix(client): overlay not appearing when multiple vite clients were lo…
Browse files Browse the repository at this point in the history
…aded (#18647)
  • Loading branch information
seokju-na authored Nov 21, 2024
1 parent a10e741 commit 27d70b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ const hasDocument = 'document' in globalThis

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

function clearErrorOverlay() {
Expand Down

0 comments on commit 27d70b5

Please sign in to comment.