Why Your v0 or Bolt App Fails to Deploy on Vercel (and How to Fix It)

Quick answer: Your v0 or Bolt app works in preview but the Vercel build fails? Here are the most common build errors and how to fix each one.

The error

Error: Command "npm run build" exited with 1

The real cause is earlier in the build log. Scroll up to the first red line.

Common causes and fixes

1. TypeScript errors (the dev server tolerates them, but next build doesn't)

Type error: Property 'x' does not exist on type 'y'.

Run npm run build locally and fix each error. As a temporary measure only, you can skip the type check:

// next.config.js
module.exports = { typescript: { ignoreBuildErrors: true } };

Since Next.js 16, next build no longer runs ESLint, and the eslint option in next.config.js was removed. If your build still fails on lint errors, your build script runs a linter itself, so fix those errors or run lint as a separate step.

2. Missing environment variables

supabaseUrl is required. or undefined API keys. Add them in Vercel → Project → Settings → Environment Variables, then redeploy. Variables that are read in the browser need the NEXT_PUBLIC_ prefix.

3. Module not found (case sensitivity)

Vercel builds on Linux, so ./components/Header ≠ ./components/header. Fix the imports or rename the files. (In git, use git mv for case-only renames.)

4. Dependency conflicts

npm ERR! ERESOLVE unable to resolve dependency tree. Align versions in package.json. As a fallback, set the Install Command to npm install --legacy-peer-deps.

5. Errors while prerendering a page

Error occurred prerendering page "/dashboard". The page fetches data or uses window at build time. Move browser code into useEffect, or make the route dynamic:

export const dynamic = 'force-dynamic';

6. Wrong framework or output settings (common with Bolt/Vite apps)

For Vite, set Framework Preset to Vite, Build Command to npm run build, and Output Directory to dist. For client-side routing, add vercel.json:

{ "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] }

7. Node version mismatch

Vercel currently supports Node.js 24.x (the default) and 22.x. Node.js 20 was deprecated on October 1, 2026, so new deployments pinned to 20.x fail. Set the version in Project Settings → Build and Deployment, or add "engines": { "node": "24.x" } to package.json (this overrides the Project Settings value).

FAQ

Why does it work in the v0/Bolt preview? Previews run a dev server, which skips type checks and prerendering. Do I need to redeploy after adding env vars? Yes. Existing deployments don't pick up new values.

Still stuck? Paste your exact error into the free Error Fixer to get a plain-English cause, the fix, and a prompt to paste back into your AI tool.

Get the free "10 Prompts That Fix Broken AI Code" pack

Join the FixKit AI newsletter: one short email a week with real errors from Cursor, Lovable, Bolt & Replit users and how to fix them. Unsubscribe anytime.

Newsletter signup powered by beehiiv. We only use your email to send the newsletter.