Next.js Discord

Discord Forum

Next 16 proxy: URLPattern is not a constructor

Answered
Siberian posted this in #help-forum
Open in Discord
SiberianOP
Hi, I’m trying to upgrade to Next 16 and now run into “URLPattern is not a constructor” for my proxy.ts. Checking its value it’s undefined. I’m importing it from next/server.

Applying a polyfil in instrumentation works locally but not on Vercel. Any ideas what could be going wrong? Weirdly enough docs recommend using this and I see no (recent) issues about this.
Answered by Siberian
import "urlpattern-polyfill";

in proxy.ts instead of using instrumentation worked
View full answer

1 Reply

SiberianOP
import "urlpattern-polyfill";

in proxy.ts instead of using instrumentation worked
Answer