Deploying a Next.js Monorepo to Cloudflare Workers: Lessons from the Trenches
Earlier this year, I migrated my personal site from Netlify to Cloudflare Pages. The experience was smooth enough to get me thinking about what Cloudflare could do for a more demanding workload. A ...

Source: DEV Community
Earlier this year, I migrated my personal site from Netlify to Cloudflare Pages. The experience was smooth enough to get me thinking about what Cloudflare could do for a more demanding workload. A real production monorepo. Multiple Next.js apps. Shared packages. Real users. A few months later, that project is running entirely on Cloudflare Workers. This post is the story of how we got there. The Setup The monorepo contains three Next.js 16 apps and a set of shared packages, all managed with Nx 22 and pnpm workspaces. Shared code, such as components, utilities, types, hooks, and config, lives in packages/ and is consumed by each app via TypeScript path aliases. The apps range from a lightweight customer-facing site to a heavier dashboard with auth middleware, i18n, and Sentry. We were deployed on Firebase Hosting with Cloud Functions and a custom GitHub Actions pipeline. It worked. Until it didn’t. Why We Left Firebase This was not a single decision. It was a slow accumulation of fricti