Reaching 1MB size limit with nextjs on workers

Hey community / cloudflare team, im trying the new next.js on workers approach (opennext adapter) instead of using next-on-pages but im getting size limit error
▲ [WARNING] Here are the 5 largest dependencies included in your script:

-
node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/node-fetch/index.js
- 784.40 KiB
- .worker-next/index.mjs - 674.17 KiB
-
node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/terser/bundle.min.js
- 463.62 KiB
-
.next/standalone/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js
- 332.93 KiB
- .worker-next/.next/standalone/.next/server/chunks/250.js - 281.62 KiB
If these are unnecessary, consider removing them



✘ [ERROR] A request to the Cloudflare API (....) failed.

Your Worker exceeded the size limit of 1 MiB. Refer to the Workers documentation
(https://developers.cloudflare.com/workers/observability/errors/#errors-on-worker-upload) for more
details. [code: 10027]

If you think this is a bug, please open an issue at:
https://github.com/cloudflare/workers-sdk/issues/new/choose


 ELIFECYCLE  Command failed with exit code 1.
▲ [WARNING] Here are the 5 largest dependencies included in your script:

-
node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/node-fetch/index.js
- 784.40 KiB
- .worker-next/index.mjs - 674.17 KiB
-
node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/terser/bundle.min.js
- 463.62 KiB
-
.next/standalone/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js
- 332.93 KiB
- .worker-next/.next/standalone/.next/server/chunks/250.js - 281.62 KiB
If these are unnecessary, consider removing them



✘ [ERROR] A request to the Cloudflare API (....) failed.

Your Worker exceeded the size limit of 1 MiB. Refer to the Workers documentation
(https://developers.cloudflare.com/workers/observability/errors/#errors-on-worker-upload) for more
details. [code: 10027]

If you think this is a bug, please open an issue at:
https://github.com/cloudflare/workers-sdk/issues/new/choose


 ELIFECYCLE  Command failed with exit code 1.
Of course im using the free plan, but the app is quite simple, I was not expecting getting this too earlier. Any tip? thank you!
1 Reply
Walshy
Walshy3mo ago
Yeah it's known that the bundle is quite big today, the team is aware and figuring out how to reduce it
Want results from more Discord servers?
Add your server