cloudflare-nextjs

Deploy Next.js applications to Cloudflare Workers using the OpenNext adapter.

204|30|Updated Nov 8, 2025
One-click install
npx skills add https://github.com/secondsky/claude-skills --skill cloudflare-nextjs-secondsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-nextjs
Source: https://github.com/secondsky/claude-skills/tree/main/plugins/cloudflare-nextjs/skills/cloudflare-nextjs
Command: npx skills add https://github.com/secondsky/claude-skills --skill cloudflare-nextjs-secondsky

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Deploy Next.js apps to Cloudflare Workers using the OpenNext adapter, enabling SSR/ISR on edge, with careful handling of worker size limits and runtime compatibility.

Core Features & Use Cases

  • Next.js App Router and Pages Router deployments on Cloudflare Workers
  • Server Rendering, ISR, and edge caching with OpenNext adapter
  • Guidance on runtime compatibility, D1/R2/KV bindings, and worker size limits

Quick Start

Follow the OpenNext Cloudflare setup steps to scaffold a Next.js project for Workers and run a local/edge deployment.

Frequently Asked Questions about cloudflare-nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a Next.js application to Cloudflare Workers?

Deploy Next.js to Cloudflare Workers using the OpenNext Cloudflare adapter. Configure wrangler.jsonc and open-next.config.ts, enable Node.js runtime compatibility, and run wrangler deploy. The adapter handles SSR, ISR, and edge caching automatically.

Does Next.js support server-side rendering on Cloudflare Workers?

Yes. Next.js supports SSR and ISR on Cloudflare Workers through OpenNext adapter, rendering pages on edge and caching with KV. Both App Router and Pages Router are supported with full middleware capabilities.

What are the worker size limits when deploying Next.js to Cloudflare?

Cloudflare Workers have a 3 MiB limit on free tier and 10 MiB on paid plans. OpenNext optimizes bundle size, but you must monitor and configure bindings (D1, R2, KV, AI) carefully to stay within limits.

Can I use Cloudflare KV, D1, and R2 bindings with Next.js on Workers?

Yes. OpenNext on Cloudflare supports D1, R2, KV, and AI bindings through request-scoped database configuration. Bindings are accessed server-side and require proper setup in wrangler.jsonc for production edge hosting.

What's the difference between deploying Next.js to Cloudflare Workers versus traditional hosting?

Cloudflare Workers deployment runs Next.js at edge globally with SSR/ISR, eliminating origin latency. Trade-offs include strict worker size limits and Node.js compatibility requirements, making it ideal for low-latency, content-heavy applications.

Do I need Node.js compatibility enabled to run Next.js on Cloudflare Workers?

Yes. Node.js runtime (nodejs_compat) is required to deploy Next.js on Cloudflare Workers. OpenNext relies on this compatibility layer to execute server-side rendering and middleware.