migrate-to-vinext
Skill9.1k starsChanged 2 months agoMITView on GitHub
Migrates Next.js projects to vinext (Vite-based Next.js reimplementation). Load when asked to migrate, convert, or switch from Next.js to vinext. Handles compatibility scanning, package replacement, Vite config generation, ESM conversion, and deployment setup (Cloudflare Workers natively, other platforms via Nitro).
- Installs packages
Trending
Quiet since October.about the whole repository
Who's talking about cloudflare/vinext
- A Hacker News story“Vinext – The Next.js API surface, reimplemented on Vite”Hacker News · Feb 25, 2026 · 17 points
- @wojtekmaj.pl“About that... Oh? github.com/cloudflare/v...”Bluesky · Feb 24, 2026 · 9 likes
- @midu.dev“¡Cloudflare saca su propia versión de Next.js! Basado en Vite y compatible con toda la API actual. Se llama …”Bluesky · Feb 25, 2026 · 8 likes
- @fry69.dev“5 days old and ~5k stars, not too shabby for a vibe coded project/rewrite -> github.com/cloudflare/v... …”Bluesky · Mar 1, 2026 · 4 likes
- crowterliam/nextsms“build(deps-dev): bump the development group with 9 updates”GitHub · May 20, 2026 · 2 reactions
The biggest 5 of 42 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 42
Talked about on GitHub, Bluesky and Hacker News (42 times).
On GitHub · 34
- May 20, 2026build(deps-dev): bump the development group with 9 updates — crowterliam/nextsms2 reactions · 3 comments
- Oct 5, 2026build(deps-dev): bump the development group with 8 updates — SyberLabs/OmniOS1 reaction · 1 comment
- Sep 29, 2026fix(frontend): restore frontend static exports — opanel-mc/opanel1 reaction · 1 comment
- Sep 28, 2026Upgrade vinext to beta.13 and align Vite+ configuration — langgenius/dify1 reaction
- Sep 22, 2026chore(deps): upgrade vinext and simplify CSS asset aliases — langgenius/dify1 reaction · 1 comment
29 more on GitHub
- Sep 20, 2026fix(core): adapt rsc handler to new vinext request format — opanel-mc/opanel1 reaction · 3 comments
- Sep 14, 2026Windows legacy installer treats downloaded PowerShell as bytes — voidzero-dev/vite-plus1 reaction
- Aug 21, 2026fix(frontend): guard route-specific URL updates — opanel-mc/opanel1 reaction
- Aug 21, 2026chore(deps): bump @vinext/cloudflare from 1.0.0-beta.5 to 1.0.0-beta.6 — ClashKingInc/ClashKingDashboard1 reaction
- Aug 21, 2026chore(deps): bump vinext from 1.0.0-beta.5 to 1.0.0-beta.6 — ClashKingInc/ClashKingDashboard1 reaction
- Aug 18, 2026Use validated GPT-5.6 Bonk configuration — cloudflare/workerd1 reaction · 4 comments
- Aug 14, 2026chore(deps): bump vinext from 1.0.0-beta.4 to 1.0.0-beta.5 — ClashKingInc/ClashKingDashboard1 reaction
- Aug 14, 2026chore(deps): bump @vinext/cloudflare from 1.0.0-beta.4 to 1.0.0-beta.5 — ClashKingInc/ClashKingDashboard1 reaction
- Jul 15, 2026chore(deps): bump the control-center-minor-patch group in /sites/unigrok-control-center with 11 updates — djtelicloud/grok-mcp-server1 reaction · 2 comments
- May 23, 2026`clean-conversation-sidebar` - Update feature — refined-github/refined-github1 reaction
- Mar 31, 2026fix(rsc): align export async function checks — vitejs/vite-plugin-react1 reaction
- Mar 20, 2026make package.json work with npm — hyperb1iss/next-dynenv1 reaction · 2 comments
- Mar 20, 2026pnpm cannot install vinext@18fe3ea in web, what is vinext@18fe3ea — langgenius/dify1 reaction · 2 comments
- Mar 12, 2026chore: update vinext — langgenius/dify1 reaction · 1 comment
- Feb 27, 2026fix(nextjs): make @clerk/nextjs ESM-safe for non-Node.js runtimes — clerk/javascript1 reaction · 10 comments
- Feb 25, 2026Support Cloudflare Vinext (Next.js on Vite/Workers) — getsentry/sentry-javascript1 reaction · 1 comment
- Feb 25, 2026[Refactor/Chore] Add vinext as dev server — langgenius/dify1 reaction
- Oct 5, 2026Bump the minor-and-patch group with 8 updates — jbouder/acolyte0 reactions
- Oct 4, 2026deps: bump the safe-npm-updates group across 1 directory with 15 updates — gokulggovardhan/lumeo0 reactions
- Oct 4, 2026[C3] Bump create-vinext-app from 1.0.0-beta.2 to 1.0.0 in /packages/create-cloudflare/src/frameworks — SharbelM82/workers-sdk0 reactions · 1 comment
- Oct 4, 2026[C3] Bump create-vinext-app from 1.0.0-beta.3 to 1.0.0 in /packages/create-cloudflare/src/frameworks — rosesreads0711-hash/workers0 reactions · 2 comments
- Oct 4, 2026[C3] Bump create-vinext-app from 1.0.0-beta.3 to 1.0.0 in /packages/create-cloudflare/src/frameworks — discoduwu-ui/workers-sdk0 reactions · 2 comments
- Oct 4, 2026[C3] Bump create-vinext-app from 1.0.0-beta.3 to 1.0.0 in /packages/create-cloudflare/src/frameworks — TELEGRAM-BOT-AUTOMATION/workers-sdk0 reactions · 2 comments
- Oct 4, 2026[C3] Bump create-vinext-app from 1.0.0-beta.3 to 1.0.0 in /packages/create-cloudflare/src/frameworks — rosesreads0711-hash/workers-sdk0 reactions · 2 comments
- Oct 4, 2026[C3] Bump create-vinext-app from 1.0.0-beta.3 to 1.0.0 in /packages/create-cloudflare/src/frameworks — cloudflare/workers-sdk0 reactions · 3 comments
- Oct 1, 2026chore(deps): bump the production-dependencies group with 3 updates — Stonez-Digital/skillpass-africa0 reactions · 1 comment
- Sep 18, 2026build(deps): bump @vinext/cloudflare from 1.0.0-beta.7 to 1.0.0-beta.8 — Igorcbraz/GitAscii0 reactions · 1 comment
- Sep 7, 2026Bump @vinext/cloudflare from 1.0.0-beta.6 to 1.0.0-beta.7 — Artifex-x/fixfirst0 reactions · 2 comments
- Sep 6, 2026build(deps-dev): Bump the cloudflare group with 5 updates — TM-threemavithana/sentinel-edge0 reactions
On Bluesky · 7
- Feb 24, 2026About that... Oh? github.com/cloudflare/v... — @wojtekmaj.pl9 likes and reposts · 1 reply
- Feb 25, 2026¡Cloudflare saca su propia versión de Next.js! Basado en Vite y compatible con toda la API actual. Se llama Vinext y ofrece: ✓ Builds hasta… — @midu.dev8 likes and reposts · 1 reply
- Mar 1, 20265 days old and ~5k stars, not too shabby for a vibe coded project/rewrite -> github.com/cloudflare/v... #NextJS #Vite — @fry69.dev4 likes and reposts · 1 reply
- Feb 26, 2026Drop-in Next.js replacement built on Vite with AI migration tools - keep your existing code, get faster builds, deploy anywhere… — @arifsolmaz.bsky.social1 likes and repost
- Feb 25, 20261 dev at @Cloudflare + AI replicated @nextjs in a week! It’s called vinext since it runs on Vite & the “vi” prefix is also shared with… — @everydevai.bsky.social1 likes and repost
2 more on Bluesky
- Feb 25, 2026VinextはViteベースでNext.jsのAPIを再現したツールらしい Cloudflare Workersへのデプロイが容易で高速化に期待できるかな yug1224 starred cloudflare/vinext… — @yug1224.com1 likes and repost
- Feb 25, 2026CloudflareがNext.JSをViteベースのものに1週間で1人がAIで書き直してvinext github.com/cloudflare/v... としてリリース — @tkusano.jp1 likes and repost
On Hacker News · 1
- Feb 25, 2026Vinext – The Next.js API surface, reimplemented on Vite17 points · 2 comments
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- tests/fixtures/app-route-file-collision/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 0 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Run vinext check (install vinext first if needed via npx vinext check).
- Very specific: line 45
Run vinext init. This command:
- Very specific: line 57
If vinext init succeeds, skip to Phase 4 (Verify).
- Very specific: line 61
Use this as a fallback when vinext init doesn't work or the user wants full control.
- Very specific: line 89
Add "type": "module" to package.json.
- Very specific: line 99
If the project already has custom Vite config, prefer Vite 8-native keys when editing it: oxc, optimizeDeps.rolldownOptions, and …
- Very specific: line 121
Ensure vinext-generated output and caches are ignored:
- Very specific: line 132
If the user wants to deploy to Cloudflare Workers, use npx @vinext/cloudflare deploy.
- Very specific: line 153
IMPORTANT: Do not use getPlatformProxy(), getRequestContext(), or custom worker entries with fetch(request, env) to access bindings.
- Very specific: line 189
Run the generated dev:vinext script (or npx vite dev) to start the development server
- Very specific: line 213
Do not skip the compatibility check: Run vinext check before migration to surface issues early.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Migrate Next.js to vinext
vinext reimplements the Next.js API surface on Vite. Existing app/, pages/, and next.config.js work as-is — migration is a package swap, config generation, and ESM conversion. No changes to application code required.
FIRST: Verify Next.js Project
Confirm next is in dependencies or devDependencies in package.json. If not found, STOP — this skill does not apply.
Detect the package manager from the lockfile:
| Lockfile | Manager | Install | Uninstall |
pnpm-lock.yaml | pnpm | pnpm add | pnpm remove |
yarn.lock | yarn | yarn add | yarn remove |
bun.lockb / bun.lock | bun | bun add | bun remove |
package-lock.json or none | npm | npm install | npm uninstall |
Detect the router: if an app/ directory exists at root or under src/, it's App Router. If only pages/ exists, it's Pages Router. Both can coexist.
Quick Reference
| Command | Purpose |
vinext check | Scan project for compatibility issues, produce scored report |
vinext init | Automated migration — installs deps, generates config, converts to ESM |
npx vite dev | Development server with HMR |
npx vite build | Production build (multi-environment for App Router) |
vinext start | Local production server |
npx @vinext/cloudflare deploy | Build and deploy to Cloudflare Workers |
vp exec vinext-cloudflare deploy | Build and deploy to Cloudflare Workers with Vite+ |
Phase 1: Check Compatibility
Run vinext check (install vinext first if needed via npx vinext check). Review the scored report. If critical incompatibilities exist, inform the user before proceeding.
See references/compatibility.md for supported/unsupported features and ecosystem library status.
Phase 2: Automated Migration (Recommended)
Run vinext init. This command:
- Runs
vinext checkfor a compatibility report - Installs
viteas a devDependency (and@vitejs/plugin-rscfor App Router) - Adds
"type": "module"to package.json - Renames CJS config files (e.g.,
postcss.config.js→.cjs) to avoid ESM conflicts - Adds
dev:vinextandbuild:vinextscripts to package.json - Generates a minimal
vite.config.ts - Adds
/dist/and.vinext/to.gitignore
This is non-destructive — the existing Next.js setup continues to work alongside vinext. Use the dev:vinext script to test before fully switching over.
If vinext init succeeds, skip to Phase 4 (Verify). If it fails or the user prefers manual control, continue to Phase 3.
Phase 3: Manual Migration
Use this as a fallback when vinext init doesn't work or the user wants full control.
3a. Replace packages
# Example with npm:
npm uninstall next
npm install vinext
npm install -D vite
# App Router only:
npm install -D @vitejs/plugin-rsc3b. Update scripts
Replace all next commands in package.json scripts:
| Before | After | Notes |
next dev | vite dev | Dev server with HMR |
next build | vite build | Production build |
next start | vinext start | Local production server |
next lint | vinext lint | Delegates to eslint/oxlint |
Preserve Vite-compatible flags: next dev --port 3001 → vite dev --port 3001. Translate Next-only build flags into vinext() options in vite.config.ts instead of forwarding them to Vite.
3c. Convert to ESM
Add "type": "module" to package.json. Rename any CJS config files:
postcss.config.js→postcss.config.cjstailwind.config.js→tailwind.config.cjs- Any other
.jsconfig that usesmodule.exports
3d. Generate vite.config.ts
See references/config-examples.md for config variants per router and deployment target.
If the project already has custom Vite config, prefer Vite 8-native keys when editing it: oxc, optimizeDeps.rolldownOptions, and build.rolldownOptions. Older esbuild and build.rollupOptions settings still work for now but are migration targets.
Pages Router (minimal):
import vinext from "vinext";
import { defineConfig } from "vite";
export default defineConfig({ plugins: [vinext()] });App Router (minimal):
import vinext from "vinext";
import { defineConfig } from "vite";
export default defineConfig({ plugins: [vinext()] });vinext auto-registers @vitejs/plugin-rsc for App Router when the rsc option is not explicitly false. No manual RSC plugin config needed for local development.
3e. Update .gitignore
Ensure vinext-generated output and caches are ignored:
/dist/
.vinext/Phase 4: Deployment (Optional)
Option A: Cloudflare Workers (recommended for Cloudflare)
If the user wants to deploy to Cloudflare Workers, use npx @vinext/cloudflare deploy. With Vite+, use vp exec vinext-cloudflare deploy when running the locally installed bin. It builds and deploys via wrangler.
For manual setup or custom worker entries, see references/config-examples.md.
Cloudflare Bindings (D1, R2, KV, AI, etc.)
To access Cloudflare bindings (D1, R2, KV, AI, Queues, Durable Objects, etc.), use import { env } from "cloudflare:workers" in any server component, route handler, or server action:
import { env } from "cloudflare:workers";
export default async function Page() {
const result = await env.DB.prepare("SELECT * FROM posts").all();
return <div>{JSON.stringify(result)}</div>;
}This works because @cloudflare/vite-plugin runs server environments in workerd, where cloudflare:workers is a native module. No custom worker entry, no getPlatformProxy(), no special configuration needed. Just import and use.
Bindings must be defined in wrangler.jsonc. For TypeScript types, run wrangler types.
IMPORTANT: Do not use getPlatformProxy(), getRequestContext(), or custom worker entries with fetch(request, env) to access bindings. These are older patterns. cloudflare:workers is the recommended approach and works out of the box with vinext.
Option B: Other platforms (via Nitro)
For deploying to Vercel, Netlify, AWS, Deno Deploy, or any other Nitro-supported platform, add the Nitro Vite plugin:
npm install nitro// vite.config.ts
import { defineConfig } from "vite";
import vinext from "vinext";
import { nitro } from "nitro/vite";
export default defineConfig({
plugins: [vinext(), nitro()],
});Build and deploy:
NITRO_PRESET=vercel npx vite build # Vercel
NITRO_PRESET=netlify npx vite build # Netlify
NITRO_PRESET=deno_deploy npx vite build # Deno Deploy
NITRO_PRESET=node npx vite build # Node.js serverNitro auto-detects the platform in most CI/CD environments, so the preset is often unnecessary.
Note: For Cloudflare Workers, Nitro works but the native integration (npx @vinext/cloudflare deploy / vp exec vinext-cloudflare deploy / @cloudflare/vite-plugin) is recommended for the best developer experience with cloudflare:workers bindings, KV caching, and one-command deploys.
Phase 5: Verify
- Run the generated
dev:vinextscript (ornpx vite dev) to start the development server - Confirm the server starts without errors
- Navigate key routes and check functionality
- Report the result to the user — if errors occur, share full output
See references/troubleshooting.md for common migration errors.
Known Limitations
| Feature | Status |
next/image optimization | Remote images via @unpic; no build-time optimization |
next/font/google | CDN-loaded, not self-hosted |
| Domain-based i18n | Not supported; path-prefix i18n works |
next/jest | Not supported; use Vitest |
| Turbopack/webpack config | Ignored; use Vite plugins instead |
runtime / preferredRegion | Placement ignored; edge App Router pages skip ISR outside cacheComponents |
| PPR (Partial Prerendering) | Use "use cache" directive instead (Next.js 16 approach) |
Anti-patterns
- Do not modify
app/,pages/, or application code. vinext shims allnext/*imports — no import rewrites needed. - Do not rewrite
next/*imports tovinext/*in application code. Imports likenext/image,next/link,next/serverresolve automatically. - Do not copy webpack/Turbopack config into Vite config. Use Vite-native plugins instead.
- Do not skip the compatibility check. Run
vinext checkbefore migration to surface issues early. - Do not remove
next.config.jsunless replacing it withnext.config.tsor.mjs. vinext reads it for redirects, rewrites, headers, basePath, i18n, images, and env config. - Do not use
getPlatformProxy()or custom worker entries for bindings. Useimport { env } from "cloudflare:workers"instead. This is the modern pattern and works out of the box with vinext and@cloudflare/vite-plugin. - For Cloudflare Workers, prefer the native integration over Nitro.
npx @vinext/cloudflare deploy/vp exec vinext-cloudflare deploy/@cloudflare/vite-pluginprovides the best experience withcloudflare:workersbindings, KV caching, and image optimization. Nitro works for Cloudflare but the native setup is recommended.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

