Skip to content

Commit 45bcd17

Browse files
committed
fix(location): use explicit window.location
1 parent 3de416d commit 45bcd17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/util/url.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export function resolve(from: string, to: string) {
4444
* @returns
4545
*/
4646
export function cwd() {
47-
if (typeof window !== "undefined" && window.location) {
48-
return location.href;
47+
if (typeof window !== "undefined" && window.location && window.location.href) {
48+
return window.location.href;
4949
}
5050

5151
if (typeof process !== "undefined" && process.cwd) {

0 commit comments

Comments
 (0)