Skip to content

Commit

Permalink
fix: location.toString in prerender
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian authored Jun 27, 2024
1 parent 6a42afe commit 81f2669
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ 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)
: String(u[i]);

Check failure on line 350 in src/prerender.ts

View workflow job for this annotation

GitHub Actions / Test

Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'URL'.
} catch {}
}

Expand Down

0 comments on commit 81f2669

Please sign in to comment.