From 56f51f6d4afdd292c87ad1b09ce67b555f7847ed Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:44:50 -0500 Subject: [PATCH] fix: `location.toString` in prerender --- src/prerender.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/prerender.ts b/src/prerender.ts index a37c00f..a84ae8f 100644 --- a/src/prerender.ts +++ b/src/prerender.ts @@ -345,7 +345,11 @@ export function PrerenderPlugin({ for (const i in u) { try { // @ts-ignore - globalThis.location[i] = String(u[i]); + globalThis.location[i] = + i === "toString" + ? u[i].bind(u) + : // @ts-ignore + String(u[i]); } catch {} }