NextJS gives TypeError but only on cloudflare pages

I get "TypeError: Illegal invocation: function called with incorrect this reference. See https://developers.cloudflare.com/workers/observability/errors/#illegal-invocation-errors for details." but only when deployed. I do not get any errors on my localhost.
Cloudflare Docs
Errors and exceptions · Cloudflare Workers docs
Review Workers errors and exceptions.
1 Reply
KRILLE
KRILLEOP21h ago
I have found that the issue is with the vercel version 3.1.2 I am trying to force to 3.1.1 but it won't work properly. I have added it to package.json and pnpm-lock but it still builds with vercel 3.1.2 cli. I am guessing that it is because of the build command pnpm dlx @Cloudflare/next-on-pages
Want results from more Discord servers?
Add your server