Next.js Error: Function Script over 1MiB size limit

Recieved this Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large) How to tackle? All I did was added auth with clerkdev. I am using edge functions.
4 Replies
James
James16mo ago
All I can really say is to ensure that you are using at least next-on-pages v1.0.2. There are lots of improvements in the new versions to reduce bundle size. If you are using the latest version and are still running into issues with the bundle size, you could try upgrading your Pages / Workers to Paid which has a 5 MB limit for the worker size instead. It's also possible you have some dependencies which could be rather beefy that could be replaced with something else.
reavatar
reavatar16mo ago
v1.0.2 didn't helped. I can switch to paid but then I am not sure if it is below 5 MB.
James
James16mo ago
You could try checking the zipped size of the _worker.js directory in .vercel/output/static perhaps?
reavatar
reavatar16mo ago
This is 5$/month plan correct? I also other 20$ pro plan (cloudflare pro)_
Want results from more Discord servers?
Add your server