Skip to content

Commit c8d692b

Browse files
authored
fix missing polyfill URLPattern (#484)
* fix missing polyfill * Create chilled-eels-sort.md
1 parent f61b0e9 commit c8d692b

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

.changeset/chilled-eels-sort.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"open-next": patch
3+
---
4+
5+
fix missing polyfill URLPattern

packages/open-next/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"chalk": "^5.3.0",
4747
"esbuild": "0.19.2",
4848
"path-to-regexp": "^6.2.1",
49-
"promise.series": "^0.2.0"
49+
"promise.series": "^0.2.0",
50+
"urlpattern-polyfill": "^10.0.0"
5051
},
5152
"devDependencies": {
5253
"@types/aws-lambda": "^8.10.109",

packages/open-next/src/plugins/edge.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ if(!globalThis.SubtleCrypto) {
141141
if(!globalThis.Crypto) {
142142
globalThis.Crypto = webcrypto.Crypto
143143
}
144+
// We also need to polyfill URLPattern
145+
if (!globalThis.URLPattern) {
146+
await import("urlpattern-polyfill");
147+
}
144148
`
145149
}
146150
${wasmFiles

pnpm-lock.yaml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)