cloudflare-nextjs

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

16|7|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/jackspace/ClaudeSkillz --skill cloudflare-nextjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-nextjs
Source: https://github.com/jackspace/ClaudeSkillz/tree/main/skills/cloudflare-nextjs
Command: npx skills add https://github.com/jackspace/ClaudeSkillz --skill cloudflare-nextjs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, and includes scripts (resource) and references (resource) components.

Cloudflare Next.js Deployment Skill

Deploy Next.js applications (App Router and Pages Router) to Cloudflare Workers using the OpenNext adapter for production-ready serverless Next.js hosting.

What This Skill Covers

  • Setup for new projects and migrations
  • Wrangler configuration and OpenNext setup
  • Dual testing (Next dev server + workerd preview)
  • D1, R2, KV, and Workers AI integrations
  • Prevention of worker size limits and runtime issues
  • Guidance on migrations from Vercel/AWS to Cloudflare

Quick Start

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

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 adapter, which converts your app into a worker-compatible bundle. Configure wrangler.jsonc and open-next.config.ts, then run deployment scripts to push your application to Cloudflare's serverless platform for production hosting.

Does Next.js work with Cloudflare Workers and D1 databases?

Yes, Next.js applications deployed via OpenNext fully support Cloudflare D1, R2, KV, and Workers AI. You can integrate these services directly into your server actions, API routes, and middleware while running on Cloudflare Workers.

Can I migrate my Next.js app from Vercel to Cloudflare Workers?

Yes, you can migrate existing Next.js projects to Cloudflare Workers using OpenNext. The adapter supports both App Router and Pages Router, SSR, SSG, ISR, React Server Components, and server actions, making migrations from Vercel and AWS viable.

What are common errors when deploying Next.js to Cloudflare Workers?

Common issues include exceeding worker size limits, runtime compatibility problems, and database connection scoping errors. This Skill provides guidance on preventing these issues and addresses solutions for runtime flags, worker optimization, and proper Cloudflare service integration.

How do I test Next.js locally before deploying to Cloudflare Workers?

Test dual environments: use the Next.js dev server for standard development, then preview with workerd runtime to simulate the actual Cloudflare Workers environment before deployment, ensuring compatibility.