Skip to content

Commit 2fb8527

Browse files
authoredMar 21, 2023
fix: prevent error on not set location href (#12494)
1 parent 45b5b0f commit 2fb8527

File tree

1 file changed

+1
-1
lines changed
  • packages/vite/src/node/plugins

1 file changed

+1
-1
lines changed
 

‎packages/vite/src/node/plugins/css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ function cleanScssBugUrl(url: string) {
15381538
if (
15391539
// check bug via `window` and `location` global
15401540
typeof window !== 'undefined' &&
1541-
typeof location !== 'undefined'
1541+
typeof location?.href === 'string'
15421542
) {
15431543
const prefix = location.href.replace(/\/$/, '')
15441544
return url.replace(prefix, '')

0 commit comments

Comments
 (0)
Please sign in to comment.