Skip to content

Commit 2699759

Browse files
authored
fixed createURL() for Firefox (#9464)
* fixed createURL() for Firefox * Update contributors.yml
1 parent 7dc7f35 commit 2699759

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- abdallah-nour
22
- abhi-kr-2100
3+
- AchThomas
34
- Ajayff4
45
- alany411
56
- alexlbr

packages/router/router.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,8 +3060,13 @@ function getTargetMatch(
30603060
}
30613061

30623062
function createURL(location: Location | string): URL {
3063+
// window.location.origin is "null" (the literal string value) in Firefox under certain conditions
3064+
// https://bugzilla.mozilla.org/show_bug.cgi?id=878297
3065+
// this breaks the app when a production build is served from the local file system
30633066
let base =
3064-
typeof window !== "undefined" && typeof window.location !== "undefined"
3067+
typeof window !== "undefined" &&
3068+
typeof window.location !== "undefined" &&
3069+
window.location.origin !== "null"
30653070
? window.location.origin
30663071
: "unknown://unknown";
30673072
let href =

0 commit comments

Comments
 (0)