Skip to content

Commit

Permalink
fix: location.toString in prerender (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Jun 28, 2024
1 parent 6a42afe commit 6260740
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
}

Expand Down

0 comments on commit 6260740

Please sign in to comment.