OpenNext Cloudflare 1.20.17

OpenNext Cloudflare refers to the @opennextjs/cloudflare adapter, which transforms a Next.js application into a format that can run on Cloudflare Workers.

Instead of rewriting your app, it takes the build output and converts it into a Worker-compatible package.

In simple terms:

  • Next.js builds your app

  • OpenNext transforms it

  • Cloudflare Workers runs it globally at the edge

Get Started

New apps

To create a new Next.js app, pre-configured to run on Cloudflare using @opennextjs/cloudflare, run:

npm create cloudflare@latest -- my-next-app --framework=next --platform=workers

Existing Next.js apps

The easiest way to convert an existing Next.js app is to use the migrate command:

npx @opennextjs/cloudflare migrate

This command automates all the setup steps below. If R2 is enabled on your account, it also creates an R2 bucket for caching. See the CLI documentation for more details.

OpenNext Cloudflare 1.20.17 Release Notes

Patch Changes

See details at
  • Match fallback: false routes against the decoded pathname.
  • Do not expose more Next.js internal headers on the middleware response.
  • Send the time of entries made stale by a tag to the revalidation queue.
  • Do not copy next.config headers onto the request headers.
  • Strip the internal next-resume header from incoming requests.
  • #1479 223f07f Thanks @vicb! - fix: do not serve /cdn-cgi/image/ for revalidation requests sent through WORKER_SELF_REFERENCE
  • #1427 2d4665a Thanks @jkugsiya! - fix: stop the Durable Object queue from revalidating routes again after every restart
Once a revalidation had failed, the Durable Object queue revalidated the route again every time it restarted, even after the retry succeeded or the queue gave up. The number of extra revalidations grew until the next deployment. The queue now forgets a route once it stops retrying it.
  • #1486 843723c Thanks @vicb! - fix: leave cloudflare:* imports external in the server bundle
postgres 4 maps its Workers build (src/cf.js) to the workerd condition, and that build imports cloudflare:sockets statically. With postgres 4 in serverExternalPackages, the build failed while bundling the server with:

  ✘ [ERROR] Could not resolve "cloudflare:sockets"
  
cloudflare: imports are now left to wrangler, as node: imports already are, so postgres 4 uses cloudflare:sockets in the Worker.
  • #1441 7d97fe8 Thanks @mathurshubham! - fix: stop the Durable Object queue from skipping ISR revalidations until the next deployment
With the Durable Object queue, some ISR pages stayed x-nextjs-cache: STALE until the next deployment:
  • pages that took more than about a second to revalidate,
  • pages made stale by revalidateTag after their first revalidation.
These pages are now revalidated. Affects apps using purgeCache({ type: "durableObject" }) (the NEXT_CACHE_DO_PURGE binding). Once the purge alarm had exhausted its retries (for example after the Wrong number of parameter bindings error fixed in #1289, or a purge rate limit), the Durable Object never scheduled another alarm. Every later revalidateTag / revalidatePath queued its tags but the CDN cache was never purged and pages stayed stale. The alarm is now re-armed when it is in the past. After upgrading, the next revalidation purges the queued tags without having to reset the Durable Object. See https://github.com/opennextjs/opennextjs-cloudflare/issues/929
  • #1431 8d30187 Thanks @kremnyi! - fix: retry all the failed revalidations of the Durable Object queue
When three or more failed ISR revalidations were waiting to be retried at the same time with the Durable Object queue (DOQueueHandler), only some of them were retried. The routes that were not retried stayed marked as failed, so later ISR requests for these routes did not trigger a revalidation either. These pages stayed stale until another revalidation failed or the Durable Object restarted. All the failed revalidations are now retried.
  • #1484 b6ccf33 Thanks @vicb! - fix: resolve the workerd build of packages from the installed node_modules instead of copying it
Next.js traces the packages it does not bundle with the Node.js conditions, so the files only used by the workerd build of a package are missing from .open-next. They used to be copied, along with the dependencies of the workerd build, but a dependency that Next.js had partially traced for another package was left incomplete. With serverExternalPackages: ["@sentry/nextjs"], 1.20.15 and 1.20.16 failed with:

  ✘ [ERROR] Could not resolve "@sentry/server-utils/no-diagnostic-channels"
  
Nothing is copied anymore. The server bundle resolves the packages with a workerd condition from the installed node_modules (the workerd condition wins over the Node.js ones) and uses the traced copy of a file when there is one, so that each module is bundled once. The files that were not traced are read from node_modules.

How It Works

The process is straightforward but powerful:

  1. You build your Next.js app normally

  2. OpenNext processes the build output

  3. The adapter converts it into a Worker bundle

  4. You deploy it using Wrangler to Cloudflare

This transformation step is the key innovation, enabling Next.js apps to run outside their native ecosystem.


Key Features of OpenNEXT Cloudflare

1. Full Next.js Feature Support

OpenNext Cloudflare supports most major Next.js features:

  • Server-side rendering (SSR)

  • Static site generation (SSG)

  • Incremental static regeneration (ISR)

  • API routes and middleware

  • App Router and React Server Components

This makes it suitable for real production apps, not just simple sites.


2. Node.js Runtime on Cloudflare Workers

Unlike older approaches, OpenNext uses a Node-compatible runtime inside Workers. This allows broader compatibility with existing Next.js apps.

This is a major advantage over edge-only solutions that restrict APIs.


3. Global Edge Deployment

By using Cloudflare Workers, your app runs close to users worldwide, improving latency and performance.

This is especially useful for:

  • SaaS apps

  • APIs

  • Global websites


4. Advanced Caching with R2

OpenNext integrates with Cloudflare R2 for caching features like ISR, helping reduce rebuild costs and improve response times.


5. Multi-Worker Architecture (Advanced)

You can split your app into multiple Workers for better performance and scalability, although this requires advanced configuration.


Performance and Real-World Behavior

OpenNext Cloudflare delivers strong global performance thanks to edge execution. However, performance depends heavily on caching configuration.

For example:

  • Static assets are served efficiently from CDN

  • Dynamic routes use Workers for SSR

  • Improper caching can increase CPU usage

This means optimization is critical for best results.


Developer Experience

Setting up OpenNext Cloudflare is more complex than traditional deployment.

Typical setup includes:

  • Installing @opennextjs/cloudflare

  • Configuring Wrangler

  • Managing cache and storage

  • Adjusting runtime settings

There is also a key limitation:

  • Edge runtime is not fully supported yet, requiring Node runtime instead

This adds some constraints depending on your app architecture.


Pros and Cons

Pros

  • Deploy Next.js on Cloudflare Workers

  • Avoid vendor lock-in from platforms like Vercel

  • Supports most Next.js features

  • Global edge performance

  • Open source and flexible

Cons

  • Setup complexity is high

  • Requires understanding of Cloudflare ecosystem

  • Some features still evolving

  • Windows support is limited

  • Caching and ISR require careful tuning


OpenNext Cloudflare vs Vercel

While Vercel offers the easiest Next.js deployment, OpenNext Cloudflare provides:

  • More infrastructure control

  • Multi-cloud flexibility

  • Potential cost optimization at scale

However, Vercel still wins in simplicity and developer experience.


Who Should Use OpenNext Cloudflare

This setup is ideal for:

  • Advanced developers and DevOps teams

  • Companies avoiding vendor lock-in

  • Projects needing global edge performance

  • Teams already using Cloudflare ecosystem

It is not ideal for beginners or small projects that need quick deployment.


Final Verdict

OpenNext Cloudflare is a powerful solution that unlocks true portability for Next.js applications on edge infrastructure. It brings together flexibility, performance, and control, but at the cost of complexity.

If you want full control over deployment and global performance, OpenNext Cloudflare is one of the most compelling options available today.

If you want to run Next.js apps on Cloudflare instead of being tied to a single platform, OpenNext Cloudflare is one of the most important solutions today. It combines the flexibility of OpenNext with the global edge infrastructure of Cloudflare.

OpenNext Cloudflare 1.20.17
Free
Software Informations:
Developer:

Operating System:
Framework
Date Added:
2026-11-13T08:07:20.753Z
Categories:

Post a Comment/Report Broken Link: