V0 offers three export methods: GitHub integration (recommended), ZIP download, and manual code copy. The GitHub method auto-creates a branch named v0/main-abc123, commits every AI change, and lets you create pull requests for clean merges. After export, you must install dependencies, configure environment variables, and verify that shadcn/ui components resolve correctly — the most common post-export issue is missing registry components.
Why exporting V0 projects requires careful setup
V0 projects run inside Vercel Sandbox, a managed environment that handles dependency resolution, TypeScript compilation, and module loading via esm.sh. When you export the code, that managed environment disappears. Your local machine or CI server needs to resolve all dependencies from npm, configure TypeScript path aliases, and handle Next.js build settings that V0 managed automatically. The #1 issue users face after export is shadcn component registry mismatches — V0 references components like date-picker or toast that do not exist as standalone registry entries.
- shadcn/ui components referenced by V0 do not exist in the current registry
- Environment variables from V0's Vars panel are not set in the target environment
- Tailwind v3/v4 mismatch between V0's generated code and the target project
- Missing @/ path alias configuration in projects not scaffolded by V0
- Dependencies installed via esm.sh in V0 preview are not in package.json
Error messages you might see
The component at https://ui.shadcn.com/r/styles/new-york-v4/date-picker.json was not found. It may not exist at the registry.V0 generated code referencing a shadcn component that does not exist as a standalone registry item. The date-picker is a composition of Popover and Calendar components, not a separate component.
Module not found: Error: Can't resolve '@/components/ui/button'The @/ path alias is not configured in the target project's tsconfig.json. V0 assumes this alias is configured for all imports.
You are not authorized to access the component at https://v0.dev/chat/b/xxxxxxx/json.The npx v0 add command requires authentication that may not be included in the copied command. Use the GitHub integration or ZIP download instead.
Before you start
- A V0 project ready for export
- GitHub account (for GitHub integration method)
- Node.js 18+ installed locally for running the exported project
How to fix it
Export via GitHub integration (recommended method)
The GitHub method creates a branch, auto-commits all changes, and lets you create a PR — giving you full version control and the ability to review V0's code before merging to main.
Export via GitHub integration (recommended method)
The GitHub method creates a branch, auto-commits all changes, and lets you create a PR — giving you full version control and the ability to review V0's code before merging to main.
In V0, open the Git panel from the sidebar. Click Connect, select your GitHub account or organization, and enter a repository name. V0 creates branch v0/main-abc123 and auto-commits all project files. When ready, click Open PR to create a pull request. Review the code and merge to main.
Expected result: A GitHub repository with a V0 branch containing the full project code, ready for PR review and merge.
Install dependencies and verify the build locally
V0's Vercel Sandbox resolves dependencies differently than npm or pnpm. Some packages available via esm.sh in V0 preview may need explicit installation.
Install dependencies and verify the build locally
V0's Vercel Sandbox resolves dependencies differently than npm or pnpm. Some packages available via esm.sh in V0 preview may need explicit installation.
After cloning the repository, run your package manager's install command to fetch all dependencies. Then run the Next.js build to verify everything compiles. Watch for shadcn registry errors and missing type declarations.
// Common build errors after export:// - Missing shadcn components// - Missing @types packages// - Tailwind configuration mismatch// After cloning the V0 export:// 1. npm install (or pnpm install)// 2. npx shadcn@latest add button card dialog// (add each shadcn component your project uses)// 3. npm run build// 4. Fix any remaining type errorsExpected result: The project builds successfully with no errors and all shadcn components resolve correctly.
Configure environment variables in the target environment
Environment variables set in V0's Vars panel do not transfer to your local environment or Vercel production deployment. They must be configured separately.
Configure environment variables in the target environment
Environment variables set in V0's Vars panel do not transfer to your local environment or Vercel production deployment. They must be configured separately.
Check V0's Vars panel for all environment variables your project uses. Create a .env.local file in your project root with the same key-value pairs. For Vercel production, set them in the Vercel Dashboard under Project Settings then Environment Variables.
// V0 Vars panel had:// DATABASE_URL=postgres://...// NEXT_PUBLIC_API_URL=https://api.example.com// .env.local (for local development)DATABASE_URL=postgres://user:pass@host/dbNEXT_PUBLIC_API_URL=https://api.example.com// Also set these in Vercel Dashboard for productionExpected result: The application connects to external services correctly in both local development and production.
Fix the @/ import path alias if not configured
V0 generates all imports using the @/ prefix which maps to the project root. This requires a paths configuration in tsconfig.json that some project scaffolds do not include.
Fix the @/ import path alias if not configured
V0 generates all imports using the @/ prefix which maps to the project root. This requires a paths configuration in tsconfig.json that some project scaffolds do not include.
Open tsconfig.json and verify the paths configuration includes the @/* alias pointing to ./*. If missing, add it under compilerOptions.
// tsconfig.json — missing path alias{ "compilerOptions": { "target": "es5" }}// tsconfig.json — with @/ alias{ "compilerOptions": { "target": "es5", "baseUrl": ".", "paths": { "@/*": ["./*"] } }}Expected result: All @/components/... and @/lib/... imports resolve correctly during build.
Complete code example
1{2 "compilerOptions": {3 "target": "ES2017",4 "lib": ["dom", "dom.iterable", "esnext"],5 "allowJs": true,6 "skipLibCheck": true,7 "strict": true,8 "noEmit": true,9 "esModuleInterop": true,10 "module": "esnext",11 "moduleResolution": "bundler",12 "resolveJsonModule": true,13 "isolatedModules": true,14 "jsx": "preserve",15 "incremental": true,16 "plugins": [17 {18 "name": "next"19 }20 ],21 "baseUrl": ".",22 "paths": {23 "@/*": ["./*"]24 }25 },26 "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],27 "exclude": ["node_modules"]28}Best practices to prevent this
- Use GitHub integration as your primary export method — it provides version control and PR review
- Run npm run build locally immediately after export to catch errors before deploying
- Manually verify every shadcn component your V0 project uses exists in the current registry
- Copy all environment variables from V0's Vars panel to your .env.local file and Vercel Dashboard
- Keep V0's auto-created branch (v0/main-abc123) as a reference — do not delete it until you verify the merge
- After export, check package.json for duplicate dependencies that V0 sometimes introduces
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I exported my V0 project via GitHub integration. When I cloned it locally, I get shadcn registry errors and missing module errors on build. What steps do I need to follow to get the exported V0 code running in my local Next.js environment?
Frequently asked questions
What is the best way to export a V0 project?
The GitHub integration is the recommended method. It creates a branch with auto-commits and lets you review code via pull requests. ZIP download is a fallback when GitHub is not available. The npx v0 add CLI method has been largely deprecated as of February 2026.
Why do I get shadcn registry errors after exporting V0 code?
V0 internally references shadcn components like date-picker and toast that do not exist as standalone registry entries. These components are compositions of other shadcn primitives. Either install the component dependencies manually or replace the references with the correct component combinations.
Do V0 environment variables transfer when I export?
No. Environment variables in V0's Vars panel are specific to the V0 environment. You must recreate them in your .env.local file for local development and in the Vercel Dashboard for production deployments.
Can I share a V0 project with someone who does not have a V0 account?
Yes. Use Share then Publish to create a public URL for the deployed app. For sharing the code, export to a GitHub repository and add the person as a collaborator. The ZIP download also works for sharing code directly.
What branch does V0 create when connecting to GitHub?
V0 creates a branch named v0/main-abc123 (where abc123 is a unique identifier). It never pushes directly to the main branch. You create a pull request from this branch to merge V0's code into main.
Can I import an existing GitHub repo back into V0?
Yes. Click the + icon on the V0 dashboard and select 'Import from GitHub'. V0 imports the codebase and creates a working branch. This is useful for iterating on exported code that needs further AI-assisted development.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your issue.
Book a free consultation