migrate-to-vinext

Migrates Next.js projects to vinext for Vite builds and Cloudflare Workers deployment.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/gmackie/agent-skills --skill migrate-to-vinext-gmackie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: migrate-to-vinext
Source: https://github.com/gmackie/agent-skills/tree/main/skills/migrate-to-vinext
Command: npx skills add https://github.com/gmackie/agent-skills --skill migrate-to-vinext-gmackie

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Moving a Next.js application off the Next.js toolchain onto a Vite-based runtime for Cloudflare Workers involves package swaps, ESM conversion, config generation, and compatibility risk. This Skill guides that migration step by step without requiring changes to application code. ## Core Features & Use Cases - Compatibility Scanning: Runs vinext check to produce a scored report of supported and unsupported Next.js features before any changes are made. - Automated or Manual Migration: Uses vinext init for a non-destructive automated migration, or walks through manual package replacement, script updates, ESM conversion, and vite.config.ts generation. - Cloudflare Deployment Setup: Configures wrangler.jsonc, worker entries, and bindings via vinext deploy or manual Vite multi-environment config. - Use Case: A team wants to deploy their App Router SaaS app to Cloudflare Workers. The Skill detects the package manager and router type, runs the compatibility check, migrates the project, and verifies the dev server and key routes work. ## Quick Start Migrate my Next.js project to vinext and verify the dev server starts without errors.

Frequently Asked Questions about migrate-to-vinext

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

FAQPage Schema
How do I migrate a Next.js app to Cloudflare Workers?▼

Run vinext check to scan compatibility, then vinext init to automate the migration: it installs Vite, adds ESM mode, renames CJS configs, and generates vite.config.ts. Finally use vinext deploy to build and deploy to Cloudflare Workers with auto-generated wrangler config.

Do I need to rewrite next/* imports when switching to vinext?▼

No. vinext shims all next/* imports such as next/image, next/link, next/server, and next/navigation, so application code in app/ and pages/ works unchanged. Rewriting imports to vinext/* is explicitly an anti-pattern.

Does vinext support the Next.js App Router and React Server Components?▼

Yes. vinext supports the App Router with React Server Components and Server Actions via @vitejs/plugin-rsc, which it auto-registers when an app/ directory is detected. Pages Router features like getServerSideProps and getStaticProps also work.

What Next.js features are not supported by vinext?▼

Unsupported features include domain-based i18n, Partial Prerendering (use the "use cache" directive instead), Turbopack/webpack configuration, next/jest (use Vitest), and build-time image optimization. Route segment runtime and preferredRegion configs are ignored.

Why do I get ERR_REQUIRE_ESM after migrating to vinext?▼

This error means the project is missing "type": "module" in package.json. Add it, then rename any CommonJS config files using module.exports (like postcss.config.js or tailwind.config.js) to the .cjs extension.

Why is ISR caching not persisting on Cloudflare Workers?▼

The default MemoryCacheHandler does not persist across Worker invocations. Use the KVCacheHandler from vinext/cloudflare with a KV namespace binding in wrangler.jsonc to persist ISR cache across requests.