Hitting Cloudflare Workers' 3MB size limit while deploying Next.js

A builder is trying to deploy a stack of Next.js, Better Auth, Stripe, and OpenNext (used to build a starter called LaunchSaaS) to , but the Worker bundle exceeds the platform's 3MB size limit. Even after enabling Miniflare, minifying the code, and applying basic s, the bundle stays too large.

Options under consideration include splitting the app into multiple Workers (using OpenNext's multi-worker support), moving auth or API routes to a separate service, adding or dynamic imports, swapping out heavy for lighter ones, or abandoning for a different deployment platform. The request is for real s, , and fixes from anyone who has successfully shipped a similar stack on Workers.

Key points

  • Deploying a Next.js + Better Auth + Stripe + OpenNext stack (LaunchSaaS) to
  • Worker bundle still exceeds the 3MB limit even after Miniflare, minification, and basic
  • Options considered: multi-worker split, moving auth/API elsewhere, , replacing heavy , switching platforms
Read original