blog

Next.js on Cloudflare: vinext vs OpenNext

By khurram • December 2, 2026 • 18 min read
 

Running Next.js on Cloudflare used to mean choosing between incomplete options: an edge-only adapter that broke half your dependencies, or a community adapter that worked well but lagged behind each Next.js release. In 2026 the picture changed. Cloudflare built vinext, a reimplementation of the Next.js API on Vite, and its documentation now recommends vinext as the default way to run Next.js on Workers, with OpenNext kept for existing apps. If you are weighing Cloudflare as a host for a Next.js product, this is what you need to know before you commit.

Key takeaways

  • For a new app running Next.js on Cloudflare Workers, start with vinext, Cloudflare’s recommended path, but run its compatibility check first because Cloudflare’s docs still label it beta.
  • OpenNext adapts the output of the official next build to run on Workers, while vinext is a Vite plugin that reimplements the Next.js API and never calls next build.
  • Apps that depend heavily on Cache Components, Partial Prerendering or build-time image optimization are safer on OpenNext or a Node.js host until vinext closes those gaps.
  • The Workers Paid plan has a USD 5 monthly minimum including 10 million requests and 30 million CPU milliseconds, with no charge for wall-clock time spent waiting on databases.
  • Each Workers isolate gets 128 MB of memory, so heavy image processing, PDF generation or large in-memory caches should move to a separate service or queue.

As of November 11, 2026. Facts were checked on developers.cloudflare.com, opennext.js.org, the vinext GitHub repository and the npm registry on that date. Versions: vinext 1.4.5, @opennextjs/cloudflare 1.20.16, next 16.4.6.

The short answer: for a new Next.js app on Cloudflare Workers, start with vinext, because that is Cloudflare’s recommended and best-integrated path, but run its compatibility check first and note that Cloudflare’s docs still label it beta. For an existing app already on OpenNext, stay put unless vinext’s check passes cleanly and you want its faster Vite toolchain. For apps that depend heavily on Cache Components, Partial Prerendering or build-time image optimization, OpenNext or a Node.js host is the safer choice today.

What Changed for Next.js on Cloudflare?

Three generations of tooling have tried to make Next.js run on Workers. Knowing which one a tutorial describes saves hours of confusion, because most search results still describe the older ones.

From next-on-pages to OpenNext

The first approach, @cloudflare/next-on-pages, only supported the Next.js edge runtime. Every route had to be marked as edge, and anything needing Node.js APIs failed. The OpenNext Cloudflare adapter replaced it by taking the output of next build and running it with the Next.js Node.js runtime on top of Workers’ Node.js compatibility. That made far more of the ecosystem work. The edge-only path has also aged badly for another reason: the Next.js docs now mark runtime = 'edge' as deprecated.

vinext arrives

On February 24, 2026, Cloudflare announced vinext in a blog post titled “How we rebuilt Next.js with AI in one week”, calling it experimental at the time. The npm package reached 1.0.0 on September 28, 2026, and has shipped frequent releases since. Cloudflare’s Next.js framework guide, last updated November 5, 2026, now recommends vinext as the default way to run Next.js on Workers, while also stating that “vinext is in beta”.

Where OpenNext stands

Cloudflare’s OpenNext page now opens with a note recommending vinext instead of OpenNext for new applications, and positions OpenNext for maintaining existing apps that cannot yet migrate because of a compatibility gap. OpenNext itself remains actively released, supports all Next.js 16 minor versions, and is also used by other hosts.

How Do vinext and OpenNext Work Differently?

The two tools solve the same problem from opposite ends, and that architectural choice explains nearly every difference you will see in practice.

OpenNext: adapt the real Next.js build

OpenNext runs the official next build, then transforms its output into a Worker plus static assets. Because it uses Next.js’s own compiler and server code, behavior closely matches what you see on other hosts, and new Next.js features tend to work once the adapter catches up with how they are emitted. The cost is that you inherit Next.js’s build pipeline and bundle size, and the adapter has to keep reverse-engineering build output as it changes.

vinext: reimplement the Next.js API on Vite

vinext is a Vite plugin that reimplements the Next.js API surface. It reads your existing app/, pages/, next.config.js and public/ directories but never calls next build. It builds with Vite instead, which gives you Vite’s dev server and Cloudflare’s deepest Workers integration, including bindings imported from cloudflare:workers. The trade-off is fidelity: anything Next.js does that vinext has not reimplemented, or reimplemented differently, behaves differently.

What the benchmarks do and do not say

Cloudflare’s launch post compared vinext with Next.js 16.1.6 on a single 33-route App Router app. Builds took 7.38 seconds with Next.js and Turbopack, 4.64 seconds with vinext on Vite 7, and 1.67 seconds on Vite 8 with Rolldown. Gzipped client bundles dropped from 168.9 KB to about 73 KB. Cloudflare itself called these numbers “directional, not definitive”: they measure compile and bundle speed, not production serving, Next.js ran with type checking and linting disabled, and one app is not a representative sample. Use them as a reason to test, not as a prediction for your app.

Next.js on Cloudflare compatibility check running in a terminal before a vinext migration
Run vinext’s compatibility check before anything else; it flags the Next.js features your app uses that vinext does not yet match.

Which Next.js Features Work on vinext and OpenNext?

Both tools cover the features most apps use. The gaps are in the newest and most platform-specific corners of Next.js. This table combines Cloudflare’s two support tables with vinext’s own list of known gaps.

FeaturevinextOpenNext (Cloudflare)
App Router and Pages RouterSupportedSupported
React Server Components, Server ActionsSupportedSupported
SSR with streamingSupportedSupported
ISRSupported, stale-while-revalidateSupported
Middleware and proxy.tsSupportedSupported, except Node.js middleware
‘use cache’ and Partial PrerenderingPartial, in progressSupported (experimental in Next.js)
Image optimizationPartial, at request timeSupported through Cloudflare Images
Cloudflare bindingsSupported via cloudflare:workersSupported
Build toolVitenext build

vinext’s known gaps

The vinext README lists active gaps rather than hiding them. Cache Components and Partial Prerendering are incomplete: 'use cache' is partially implemented, and cache profiles, tags, partial shells and prefetching do not match Next.js in every case. There is no full build-time image and font pipeline; Google Fonts load from the CDN. Native modules such as sharp, satori and @napi-rs/canvas can fail in App Router development mode. And preferredRegion is ignored. If your app leans on any of these, test them first.

OpenNext’s main gap

Cloudflare’s OpenNext table lists one unsupported item: Node.js middleware, introduced in Next.js 15.2. Because Next.js 16 renamed middleware to Proxy and made Proxy Node.js only, check carefully how your Proxy file behaves under OpenNext before you upgrade.

Is vinext Ready for Production?

Cloudflare’s recommendation and the beta label sit side by side in the same document, and both are meant seriously. Here is how to read them.

What the maintainers say

The README says vinext “supports substantial Next.js applications today, but it is not yet a drop-in replacement for every application or production workload”, and asks you to evaluate it against your own app. Cloudflare’s guide says to run the compatibility check and review the compatibility dashboard before adopting it for an existing production application. That is honest guidance: the core works, and the edges are still moving.

Who should adopt it now

  • Good fit: new apps, content and marketing sites, dashboards and SaaS frontends using mainstream App Router features, and teams that want Workers bindings such as KV, R2 and D1 directly in server components.
  • Test carefully: apps that rely on ISR with tag-based revalidation, heavy image processing or native modules.
  • Wait or use OpenNext: apps built around Cache Components and Partial Prerendering, or teams that cannot tolerate framework behavior differing from Vercel’s.

Keep an exit

vinext’s migration is non-destructive: next dev and next build keep working after vinext init. Keep both build paths in CI for the first few months. If you hit a blocking gap, you can deploy the same code to OpenNext or a Node.js host without rewriting the app.

How to Deploy Next.js on Cloudflare With vinext

Cloudflare documents three paths: a coding agent with the vinext skill, the CLI, or scaffolding a fresh app with create-cloudflare. The CLI path is the most repeatable. For an existing app, Cloudflare’s migration guide says to run vinext init directly rather than wrangler setup.

New project

# scaffolds a Next.js app already configured for vinext and Workers
npm create cloudflare@latest -- my-next-app --framework=next
cd my-next-app
npm run dev
npm run deploy

Existing project

# 1. scan for compatibility problems
npx vinext check

# 2. add vinext (non-interactive form shown; pick cache and image options)
npx vinext init --platform=cloudflare --name my-app \
  --cdn-cache=none --data-cache=none --image-optimization=none

# 3. develop, build and run the built Worker locally
npm run dev:vinext
npm run build:vinext

# 4. deploy
npx @vinext/cloudflare deploy --dry-run
npx @vinext/cloudflare deploy

If the app uses ISR, revalidatePath, revalidateTag or 'use cache', Cloudflare’s migration guide says to use --cdn-cache=response-store --response-store-mode=self-contained, which stores cached responses using an R2 bucket and a Durable Object owned by your Worker. If next/image serves raster or remote images, use --image-optimization=cloudflare-images.

Reading bindings

// app/products/page.tsx
import { env } from "cloudflare:workers"

export default async function Products() {
  const { results } = await env.DB.prepare("SELECT id, name FROM products").all()
  return <ul>{results.map((p) => <li key={p.id}>{p.name}</li>)}</ul>
}

vinext uses cloudflare.config.ts and the cf CLI by default instead of a Wrangler file; declare your D1, KV or R2 bindings there. With a compatibility date of 2026-08-04 or later, Node.js compatibility is on by default.

Next.js on Cloudflare migration steps from compatibility check to Workers deploy
The vinext path in five steps: check, init, replace platform-specific packages, test locally, deploy.

How Do You Move an Existing App From Vercel or OpenNext?

The framework code usually moves easily. Platform-specific services are where migrations stall, so inventory them first.

Coming from Vercel

Cloudflare’s Vercel migration guide maps each Vercel service to a Workers equivalent:

  • @vercel/kv and @vercel/edge-config to Workers KV.
  • @vercel/blob to R2.
  • @vercel/postgres to Hyperdrive in front of your Postgres, or to D1.
  • vercel.json redirects, rewrites and headers into next.config; cron jobs need a separate plan.
  • Vercel Analytics and Speed Insights removed or replaced with Cloudflare Web Analytics.

Native modules such as sharp or @resvg/resvg-js also need replacing. Do not add the nodejs_compat flag by hand for vinext projects; the guide says the recent compatibility date covers it.

Coming from OpenNext

If your OpenNext deployment is stable, there is no deadline. Cloudflare says to migrate “when compatibility allows”. A sensible approach is to run npx vinext check on each Next.js upgrade and switch once it reports no blocking issues. Your bindings, R2 buckets and D1 databases carry over; the main changes are the build scripts and the move from wrangler.jsonc and open-next.config.ts to cloudflare.config.ts.

Remove edge runtime exports either way

vinext notes that the runtime export does not choose where a route runs, and Next.js has deprecated runtime = 'edge'. Delete those exports during the move so your code reflects reality.

A cutover checklist

Before you point production DNS at Workers, run through a short list. Deploy to a workers.dev preview and run your end-to-end tests against it, not just against the local build. Compare rendered HTML for your top routes between the old host and the preview, because subtle differences in caching or headers show up there first. Check that every secret and environment variable exists in Cloudflare, including build-time variables that static generation needs. Confirm that revalidation works by editing content in your CMS or database and watching the page update. Load test the heaviest routes and watch CPU time and memory in Workers observability. Finally, keep the old deployment running for a week after the switch, so rolling back is a DNS change rather than a rebuild under pressure.

What Does It Cost and What Are the Limits?

Cloudflare’s pricing is one of the main reasons teams look at it, so get the model straight before comparing invoices.

Workers pricing (as of November 2026)

The Workers Paid plan has a USD 5 monthly minimum per account and includes 10 million requests and 30 million CPU milliseconds a month. Beyond that, requests cost USD 0.30 per million and CPU time USD 0.02 per million milliseconds. There is no charge for wall-clock duration, so time spent waiting on a database or an API is not billed, and requests for static assets are free. Cloudflare’s own worked example puts 15 million requests at 7 ms of CPU each at USD 8 for the month. The Free plan allows 100,000 requests a day with 10 ms of CPU per request, which is too tight for most server-rendered Next.js pages.

Limits that affect Next.js apps

Each isolate gets 128 MB of memory, and Cloudflare’s limits page lists a 64 MiB maximum Worker size. CPU time per request defaults to 30 seconds on paid plans and can be raised to 5 minutes. Memory is the constraint to watch: large in-memory caches, image processing or PDF generation that fit easily in a 2 to 4 GB Node.js function may not fit in 128 MB. Move that work to a separate service or queue. For more on choosing between platforms, see our guide to cloud-based solutions in software development.

Pros and Cons of Running Next.js on Cloudflare

Pros

  • Low, predictable compute pricing with no egress or duration charges.
  • Direct access to KV, R2, D1, Durable Objects and Hyperdrive from server code.
  • vinext’s Vite toolchain gives fast builds and a familiar dev server.
  • Two maintained adapters, with a non-destructive path between them.

Cons

  • vinext is labeled beta and does not yet match every Next.js behavior.
  • 128 MB memory per isolate rules out some heavy server work.
  • New Next.js features may land on Vercel before either Cloudflare path supports them.
  • Most tutorials online still describe next-on-pages, which adds confusion for new team members.

Frequently Asked Questions

Is vinext a fork of Next.js?

No. vinext does not copy the Next.js server or build pipeline. It is a Vite plugin that reimplements the Next.js API surface, so it reads the same app/ and pages/ directories, the same next.config.js, and supports the commonly used next/* modules such as next/link, next/image, next/navigation and next/headers. You still write a Next.js app, and you can still build it with next build for other hosts. The practical consequence is that behavior can differ in edge cases, which is why both Cloudflare and the vinext maintainers ask you to run vinext check and test your own routes before switching production traffic.

Can I still use OpenNext on Cloudflare?

Yes. Cloudflare still documents the OpenNext adapter and the @opennextjs/cloudflare package continues to ship releases; version 1.20.16 was published on November 3, 2026. Cloudflare documents a manual setup: install the adapter and Wrangler, add a Wrangler config pointing at .open-next/worker.js with the nodejs_compat flag, add open-next.config.ts, and use the opennextjs-cloudflare build and deploy scripts. It is a reasonable choice for apps that depend on features vinext has not finished, such as Partial Prerendering or full 'use cache' behavior.

Is Cloudflare cheaper than Vercel for Next.js?

Often, for high-traffic apps with light per-request CPU, because Workers bills CPU time rather than duration, includes 10 million requests in the USD 5 base plan and does not charge for static asset requests. But the comparison depends on your traffic shape, memory needs and team. Vercel Pro is USD 20 per developer seat per month with usage credit and offers Node.js functions with up to 4 GB of memory, and it ships new Next.js features first. Model your real traffic on both pricing pages, and include the engineering time to maintain a less mainstream deployment path. A tool-by-tool review like our tech stack audit guide helps keep the comparison honest.

What happens to my Postgres database if I move to Workers?

It can stay where it is. Cloudflare’s Hyperdrive sits between Workers and an existing Postgres or MySQL database, including managed providers such as Supabase and Neon, and pools connections so that many short-lived Worker requests do not exhaust your database’s connection limit. The Vercel migration guide suggests Hyperdrive or D1 as replacements for @vercel/postgres. Keep latency in mind: Workers run close to users by default, so a page that makes several sequential queries to a single-region database can be slower than a function running next to it. Cloudflare’s placement settings can run your Worker nearer to the database; test both settings with real queries.

Conclusion

Cloudflare has made its bet: vinext is the default, OpenNext is the fallback, and the edge-only era is over. For new apps using mainstream Next.js features, vinext on Workers is a credible, inexpensive platform, as long as you run the compatibility check, keep next build working as an exit, and watch the 128 MB memory limit. For apps that depend on the newest caching features, OpenNext or a Node.js host is the lower-risk choice until vinext’s known gaps close. As with any platform decision, the right answer comes from testing your own routes, as we argue in our piece on cloud-native architecture.

Building or moving a Next.js app to Cloudflare? Talk to Lycore. Our offshore team can run the compatibility check, plan the migration and handle the deployment at USD 25 per hour, as a fixed-price project or on a monthly retainer, and our MVP development service builds new products on the stack that fits them.