NextJS, hitting worker size limit

Hey,

I’m trying to deploy NextJS site with SSR using the https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/.

When doing so, running npx @cloudflare/next-on-pages --experimental-minify from a clean NextJS project generates a worker of a size of 996Kb, which barely fits inside the limits.

When trying the same for bigger project, in particular the one having Supabase libs a dependencies, final worker size ends up being 4.6Mb, way above the 1mb limit and the deployment fails.

Since even the basic empty NextJS projects give almost 1mb worker, I started thinking there’s something wrong with my setup or environment.

Any advice?

Thank you!

There was a recent change during developer week last week that increased the maximum size a Worker can be from 1MiB to 5MiB. :tada: Do note as well that this is the gzipped size, after bundling, so your uncompressed Worker output can actually be much larger.

This should mean that you don’t have to worry about Worker sizes for a while.

1 Like