Skip to content
cccskills
FreePublished on GitHub

opennext-cloudflare

Deploy Next.js to Cloudflare Workers using OpenNext adapter

The English summary is being prepared. Showing the original description.

Works withCloudflare
See how to install

Files included (1)

  • SKILL.md2.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

OpenNext Cloudflare Skill

Deploy Next.js applications to Cloudflare Workers using the @opennextjs/cloudflare adapter.

When to use this skill

  • Deploying to Cloudflare Workers
  • Troubleshooting Cloudflare deployment issues
  • Configuring Cloudflare-specific features (KV, R2, D1)
  • Setting up CI/CD for Cloudflare

Current setup

  • Adapter: @opennextjs/cloudflare v1.19.11
  • Next.js: v16.2.9 (--dangerouslyUseUnsupportedNextVersion)
  • Worker name: namias
  • Compatibility flags: nodejs_compat

Files

FilePurpose
wrangler.jsoncCloudflare Workers configuration
open-next.config.tsOpenNext build configuration
src/middleware.tsMiddleware (renamed from proxy.ts for compatibility)

Build and deploy

Local build

npx @opennextjs/cloudflare build

Deploy to Cloudflare

npx wrangler deploy

CI/CD

Deployment happens via GitHub Actions on push to main:

  • .github/workflows/cloudflare-deploy.yml
  • Uses CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID

Common issues

"Cloudflare worker does not have a proxy.ts"

  • Cause: src/proxy.ts is not supported in newer OpenNext versions
  • Fix: Rename to src/middleware.ts

"Unsupported version of Next.js detected"

  • Cause: OpenNext doesn't officially support Next.js 16 yet
  • Fix: Add --dangerouslyUseUnsupportedNextVersion flag to build command

"Node.js compatibility mode is required"

  • Cause: Missing nodejs_compat compatibility flag
  • Fix: Add "compatibility_flags": ["nodejs_compat"] to wrangler.jsonc

"Global fetch is not available"

  • Cause: Missing global_fetch_strictly_public flag
  • Fix: Add "compatibility_flags": ["global_fetch_strictly_public"] to wrangler.jsonc

Environment variables

Set in Cloudflare dashboard or wrangler.jsonc:

VariablePurpose
NEXT_RUNTIMESet to edge
SANITY_API_CDNSanity CDN URL
SANITY_API_WRITESanity write API URL
SANITY_AUTH_TOKENSanity auth token
SANITY_REVALIDATE_SECRETRevalidation webhook secret
CANARY_SLACK_WEBHOOKCanary notification webhook
CANARY_DISCORD_WEBHOOKCanary notification webhook
CANARY_EMAILCanary notification email
CANARY_HONEYTOKENCanary token value
HONEYPOT_USERNAMEHoneypot form field
HONEYPOT_WEBSITEHoneypot form field

Checklist

  • wrangler.jsonc has correct compatibility flags
  • src/middleware.ts exists (not proxy.ts)
  • Environment variables set in Cloudflare dashboard
  • CI/CD workflow has correct secrets
  • Build succeeds with npx @opennextjs/cloudflare build

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Audit and fix accessibility issues across the portfolio to ensure WCAG 2.1 AA compliance.

The English summary is being prepared. Showing the original description.

PP-Namias/Portfolio2Updated Oct 22, 2026

Creates a new blog post document in the Sanity studio. Use when the user wants to write a blog post, publish an article, or schedule a future post.

The English summary is being prepared. Showing the original description.

PP-Namias/Portfolio2Updated Oct 22, 2026

Creates a new certification document in the Sanity studio. Use when the user wants to add a credential, certificate, or professional accreditation to the Certifications collection.

The English summary is being prepared. Showing the original description.

PP-Namias/Portfolio2Updated Oct 22, 2026

Adds a new skill MD file to the studio's skills collection. Use when the user wants to author a new step-by-step recipe for the studio's in-app Skills tool or the .agents mirror.

The English summary is being prepared. Showing the original description.

PP-Namias/Portfolio2Updated Oct 22, 2026

Creates a new project document in the Sanity studio. Use when the user wants to add a new portfolio project, a case study, or a work sample to the Projects collection.

The English summary is being prepared. Showing the original description.

PP-Namias/Portfolio2Updated Oct 22, 2026

Creates a new experience document in the Sanity studio. Use when the user wants to add a job, role, internship, or work history entry to the Experience collection.

The English summary is being prepared. Showing the original description.

PP-Namias/Portfolio2Updated Oct 22, 2026

See all skills by PP-Namias

Report a problem with this skill