Skip to content

Commit

Permalink
fix: window undefined on server (#3408)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 authored Dec 13, 2024
1 parent ed4e563 commit 21a5f36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/web/src/package/tools/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function joinUrls(...parts: string[]): string {
}

export function createUrl(...parts: string[]): URL {
const base = typeof window === undefined ? undefined : window.location.origin;
const base =
typeof window === 'undefined' ? undefined : window.location.origin;
return new URL(joinUrls(...parts), base);
}

0 comments on commit 21a5f36

Please sign in to comment.