Skip to content

Commit

Permalink
fix: prevent error on not set location href (#12494)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschakulat committed Mar 21, 2023
1 parent 45b5b0f commit 2fb8527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/css.ts
Expand Up @@ -1538,7 +1538,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(/\/$/, '')
return url.replace(prefix, '')
Expand Down

0 comments on commit 2fb8527

Please sign in to comment.