From 7f1dc91d08fd6c0a2d9f656b0fe8fe019bdfbbed Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 29 Jan 2023 13:14:41 -0800 Subject: [PATCH 1/2] Provide a URL to replaceState for compatibility with jsdom Workaround upstream jsdom bug: https://github.com/jsdom/jsdom/issues/3504 The third argument to replaceState is optional, but provide it anyway for improved compatibility with all environments. The call to replaceState was introduced in bb7590ac85feb0cb039a5aeac2e2874c117207c9. --- packages/router/history.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From 9b632809fed20496334d79cd96e9eaed1cf7adf4 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 29 Jan 2023 15:03:26 -0800 Subject: [PATCH 2/2] Create cool-chicken-invite.md --- .changeset/cool-chicken-invite.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/cool-chicken-invite.md 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