OpenNext Cloudflare adapter
The @opennextjs/cloudflare adapter lets you deploy Next.js apps to Cloudflare Workers using the Node.js "runtime" from Next.js.
How to test build on production
We host our app on Cloudflare Pages. There are some limitations (for example, unsupported Node.js runtime, etc.), which is why it might differ compared to the local environment.
Navigate into the apps/web and run:
pnpm run pages:build
@opennextjs/cloudflare compatability
Next.js has two "runtimes" — "Edge" and "Node.js". When you use @opennextjs/cloudflare, your app can use the Node.js runtime, which is more fully featured, and allows you to use the Node.js APIs that are provided by the Cloudflare Workers runtime.
Supported Next.js features:
- App Router
- Route Handlers
- Dynamic routes
- Static Site Generation (SSG)
- Server-Side Rendering (SSR)
Not Yet Supported Next.js features
- Pages Router (you should use the App Router instead)
- Incremental Static Regeneration (ISR)
- Partial Prerendering (PPR)
- Middleware
- Image optimization (you can integrate Cloudflare Images with Next.js by following this guide)
- Experimental streaming support