diff --git a/.changeset/cool-chicken-invite.md b/.changeset/cool-chicken-invite.md new file mode 100644 index 0000000000..5dfb1a07f0 --- /dev/null +++ b/.changeset/cool-chicken-invite.md @@ -0,0 +1,5 @@ +--- +"@remix-run/router": patch +--- + +Provide a URL to replaceState for compatibility with jsdom diff --git a/packages/router/history.ts b/packages/router/history.ts index 0a36fcdfd9..249286e42d 100644 --- a/packages/router/history.ts +++ b/packages/router/history.ts @@ -603,7 +603,7 @@ function getUrlBasedHistory( // case we should log a warning as it will result in bugs. if (index == null) { index = 0; - globalHistory.replaceState({ ...globalHistory.state, idx: index }, ""); + globalHistory.replaceState({ ...globalHistory.state, idx: index }, "", window.location.href); } function getIndex(): number {