Skip to content

Commit

Permalink
Fix hash test
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Jan 4, 2023
1 parent b519bb3 commit 94efa1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4263,7 +4263,7 @@ function createDeferred() {

function getWindowImpl(initialUrl: string, isHash = false): Window {
// Need to use our own custom DOM in order to get a working history
const dom = new JSDOM(`<!DOCTYPE html>`, { url: "https://remix.run/" });
const dom = new JSDOM(`<!DOCTYPE html>`, { url: "http://localhost/" });
dom.window.history.replaceState(null, "", (isHash ? "#" : "") + initialUrl);
return dom.window as unknown as Window;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/router/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ function getUrlBasedHistory(
? window.location.origin
: window.location.href;

let href = createHref(window, to);
let href = typeof to === "string" ? to : createPath(to);
invariant(
base,
`No window.location.(origin|href) available to create URL for href: ${href}`
Expand Down

0 comments on commit 94efa1a

Please sign in to comment.