Since September, this post has sat on my list as “Why I left Next.js for Astro on Cloudflare”. Then I opened the commit log to write it, and the title stopped being true. I never left Next.js in any way that earns the word. This site’s first commit is a Next.js app, its second commit deletes it, and 50 minutes separate the two. The reason for the switch is one sentence in a commit message, and that sentence was already a year out of date.

One commit

On 23 April, at 09:39, the first commit put the shadcn/ui monorepo template into the repository: Next.js 16.1.6, React 19, Tailwind, and one page.

apps/web/app/page.tsx
<h1 className="font-medium">Project ready!</h1>
<p>You may now add components and start building.</p>
<p>We&apos;ve already added the button component for you.</p>
<Button className="mt-2">Button</Button>

That was the whole site. At 10:29, the second commit replaced it:

chore: migrate from Next.js to Astro with Cloudflare adapter

Replaces the Next.js scaffold with Astro 5 to avoid Edge Runtime
constraints on Cloudflare Pages. Adds @astrojs/cloudflare adapter
with output: server for flexible SSR/static per-route rendering.

Forty-one files changed, 300 lines in and 543 out. The app/ directory went, with next.config.mjs and the template’s ESLint and TypeScript packages. A sixteen-line astro.config.mjs came in. Thirteen of its lines are still in the file today, untouched, these two among them:

apps/web/astro.config.mjs
adapter: cloudflare(),
output: "server",

React stayed, through Astro’s React integration, with Tailwind, Turborepo and Bun. The next commit is stamped seven seconds later. It added a content collection and the first post, Understanding DNS in Plain English, so the Next.js app never held a word of mine. The site launched at siegb.dev the next day.

That commit message is the only reason the repository gives. Like most commits here, it’s co-authored with Claude, and nothing else in the repository mentions the Edge runtime. So I won’t claim more than it says. What I can do, seven months later, is check the sentence.

Was the reason true?

Next.js runs server code in one of two runtimes: Node.js, with Node’s APIs, or Edge, a deliberately smaller set. The sentence in my commit describes @cloudflare/next-on-pages, the adapter for Cloudflare Pages. The docs for the adapter that came after it say it “only supports the ‘Edge’ runtime”. With it, a server-rendered route gave up Node.

That was real, and it was old. On 8 April 2025, a year and fifteen days before my commit, Cloudflare announced the 1.0 beta of its adapter for OpenNext and wrote that using it “is now the preferred way to deploy Next applications to the Cloudflare platform, instead of Next on Pages”. The same post says the new adapter “currently only supports the Node runtime of Next.js”. The road Cloudflare preferred already ran on the Node.js runtime, without the constraint my commit left Next.js to avoid.

The rest of the record, as I write this in November 2026:

  • @cloudflare/next-on-pages has been deprecated since September 2025, seven months before my commit. Its repository was archived on 1 October 2026.
  • The OpenNext adapter’s docs have listed every Next.js 16 release as supported, on the Node.js runtime, since January 2026. My scaffold was on 16.1.6.
  • It has moved again since. Cloudflare’s Next.js guide, last updated on 5 November, says it “recommends vinext as the default way to run Next.js applications on Cloudflare Workers”. vinext is Cloudflare’s own Vite-based implementation of the Next.js API. Its 1.0 was announced on 28 September.

So the reason was true of Cloudflare Pages and its old adapter. It was not a reason to leave Next.js: the adapter Cloudflare had preferred for a year ran Next.js on its Node.js runtime.

This site isn’t on Pages either. Thirty-four minutes after the migration, I added the deploy workflow, and it runs wrangler deploy, which ships a Worker. My README went on saying “Cloudflare Pages” until the redesign.

What it cost

“Edge Runtime constraints” reads like a Next.js problem. The constraint underneath is Cloudflare’s. Server code there runs in workerd, the Workers runtime, whichever framework wrote it, and workerd is not Node. Astro’s adapter doesn’t change that. By default it even prerenders my static pages inside workerd. So the thing I switched to avoid is most of what the switch has cost me:

  • 23 April. Nineteen minutes after the migration, the first fix on the new stack was for the stack. The Cloudflare adapter needed Astro 6, and the migration had installed 5. Before noon the deploy also needed Node 22 pinned, for Astro 6.
  • 25 April. A prerendered endpoint that drew link previews wouldn’t build: resvg’s native binary can’t be bundled for Workers. The cards have come from a script that runs before the build ever since, which is its own post: Why My OG Images Are Drawn Before the Build.
  • 29 April. The dev server failed. The Miniflare release the adapter pulled in accepted compatibility dates up to 28 April, and it was the 29th. Updating the adapter fixed it.
  • 17 June. astro build died with ERR_DISPOSED while prerendering. It’s a flaky race in the tooling, and a running dev server makes it likelier, since two Miniflare runtimes compete. I stop the dev server before every build now.
  • 1 July. Astro 7 moves astro dev to the background when it detects a coding agent. Under the Cloudflare adapter, the backgrounded server crashed inside workerd on every request, and my dev script has set ASTRO_DEV_BACKGROUND=0 since.

Each one was fixed or worked around on the date beside it. But four of the five are workerd, or the tooling that brings workerd to my laptop.

One smaller cost belongs on the list: the site has run on three major versions of Astro, 5 for nineteen minutes, 6 until July, and 7 since.

What it gave

The second half of that commit message has aged better: “flexible SSR/static per-route rendering”. Under the same two lines of config, this is what grew:

  • The site is files. Posts, notes, projects, the reading list, the uses page and the now page are six content collections: MDX, Markdown and YAML in git, each checked against a schema when the site builds. A misspelled key in the reading list stops the build.
  • Static is one line per page. Every page and the RSS feed sets export const prerender = true, so what Cloudflare serves is files. The only code of mine that runs per request is three small endpoints for view counts and likes, on a D1 database I added in May.
  • Scheduling is a date check. Pages are built ahead of time, so a post with a future date simply isn’t in the build, and a scheduled deploy every Monday publishes whatever has come due.
  • No UI framework ships to the browser. React left in the redesign, with shadcn and the old layout. The pages are .astro components, Astro’s client router and a few small scripts. On 27 October, Lighthouse’s mobile run, median of three, gave the home page, the Writing index and a post performance scores of 99, 100 and 99.

The rule

The Next.js version of this site lasted 50 minutes in the log. The reason it went was a year stale, and I’m still on what replaced it seven months later. What I’d pass on:

  • You can’t pick a framework to get away from Cloudflare’s runtime. List what your code needs from Node first, such as a native addon or WebAssembly compiled at run time, then find where that code can run. Mine runs before the build.
  • Read the platform’s guide on the day you decide. Cloudflare’s preferred way to run Next.js changed in April 2025 and again in 2026. The sentence in my commit was a year behind.
  • For a site that is mostly words, Astro’s shape fits. Files with schemas, one line to make a page static, and a Worker for the three things that run per request.
  • Decide while the page still says “Project ready!”, and write the reason into the commit. Being wrong would have cost me one more commit, and that sentence is the only reason I could check myself.

This isn’t a verdict on Next.js: an older project of mine is a Next.js app, on Vercel. I didn’t leave Next.js. I deleted a template, and seven months later the commit log made me say so.