From 1bfb584e5b1d9d236692883d282a2a7079f2b384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Mon, 6 Nov 2023 17:35:06 +0900 Subject: [PATCH] fix: file link in overlay with custom backend (#14879) --- packages/vite/src/client/overlay.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/client/overlay.ts b/packages/vite/src/client/overlay.ts index 508eaf7e05bc9e..327b306f6be18f 100644 --- a/packages/vite/src/client/overlay.ts +++ b/packages/vite/src/client/overlay.ts @@ -221,7 +221,12 @@ export class ErrorOverlay extends HTMLElement { link.textContent = file link.className = 'file-link' link.onclick = () => { - fetch(`${base}__open-in-editor?file=` + encodeURIComponent(file)) + fetch( + new URL( + `${base}__open-in-editor?file=${encodeURIComponent(file)}`, + import.meta.url, + ), + ) } el.appendChild(link) curIndex += frag.length + file.length