From d059415ccd1e9ef96956205c718593a46873e9f6 Mon Sep 17 00:00:00 2001 From: Miguel da Mota Date: Wed, 23 Oct 2024 12:44:36 +0200 Subject: [PATCH] fix: exclude `basePath` in `findSourceMapURL` --- packages/next/src/client/app-find-source-map-url.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/next/src/client/app-find-source-map-url.ts b/packages/next/src/client/app-find-source-map-url.ts index 7b2006e703322..b143c755568b7 100644 --- a/packages/next/src/client/app-find-source-map-url.ts +++ b/packages/next/src/client/app-find-source-map-url.ts @@ -8,7 +8,10 @@ export const findSourceMapURL = url.searchParams.set( 'filename', - filename.replace(new RegExp(`^${document.location.origin}`), '') + filename.replace( + new RegExp(`^${document.location.origin}${basePath}`), + '' + ) ) return url.href