How to deal with the too large submission when deploying my next.js project to Cloudflare?
Unanswered
Peregrine Falcon posted this in #help-forum
Peregrine FalconOP
My Next.js project is deployed to Cloudflare, but it reports that the bundle size is too large and requires me to upgrade my plan. However, my deployment size shows only 22 MB, and even after upgrading, the limit is still 10 MB, which is not enough.
I’m sure my project isn’t very complex — it has only 12 frontend pages, all purely frontend code, with no Cloud Functions used. However, I do use internationalization (i18n).
The AI explanation says that because of i18n, each page is bundled with its own separate runtime, which increases the overall size.
How should I handle this issue and successfully deploy my project to Cloudflare?
I’m sure my project isn’t very complex — it has only 12 frontend pages, all purely frontend code, with no Cloud Functions used. However, I do use internationalization (i18n).
The AI explanation says that because of i18n, each page is bundled with its own separate runtime, which increases the overall size.
How should I handle this issue and successfully deploy my project to Cloudflare?
1 Reply
@Peregrine Falcon My Next.js project is deployed to Cloudflare, but it reports that the bundle size is too large and requires me to upgrade my plan. However, my deployment size shows only 22 MB, and even after upgrading, the limit is still 10 MB, which is not enough.
I’m sure my project isn’t very complex — it has only 12 frontend pages, all purely frontend code, with no Cloud Functions used. However, I do use internationalization (i18n).
The AI explanation says that because of i18n, each page is bundled with its own separate runtime, which increases the overall size.
How should I handle this issue and successfully deploy my project to Cloudflare?
Poodle
If its all frontend with no server stuff you dont need workers at all. add output export to your next config and itll build as a static site. then deploy to cloudflare pages as static files, no worker involved so no size limit, the i18n is probably forcing it into worker mode when you dont actually need it. The static export should handle i18n fine for client side routing.