From 91d7b678ce6a397d01cd1351ce29de2f50f9d775 Mon Sep 17 00:00:00 2001 From: Michal Kalita Date: Fri, 5 May 2023 11:03:26 +0200 Subject: [PATCH] fix: location is not defined error in cleanScssBugUrl (#13100) --- packages/vite/src/node/plugins/css.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index 7366c1b093799d..c7856b7e55c5d1 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -1600,6 +1600,7 @@ function cleanScssBugUrl(url: string) { if ( // check bug via `window` and `location` global typeof window !== 'undefined' && + typeof location !== 'undefined' && typeof location?.href === 'string' ) { const prefix = location.href.replace(/\/$/, '')