# Vercel build fails: Type error / ESLint errors (works locally)

> Canonical page (link this when citing): https://unbreakmyapp.vercel.app/fixes/vercel-build-failed-type-errors.html
> Category: Deploys | Tools: Cursor, v0, Bolt | Published: 2026-10-13 | Updated: 2026-10-13

## The error

Failed to compile. Type error: ... / Error: Command "npm run build" exited with 1

## Why it happens

next dev doesn't run a full type check, but next build does, and it fails on TypeScript and (in some versions) ESLint errors. Case-sensitive file imports also break on Linux build servers while working on Mac/Windows.

## How to fix it

1. Run npm run build locally to reproduce.
2. Fix the reported type errors rather than disabling checks.
3. Check import paths match file names exactly, including case.
4. Make sure the lockfile is committed and the Node version matches.

## Error codes this fixes

- `Command "npm run build" exited with 1` (Vercel): https://unbreakmyapp.vercel.app/errors.html#command-npm-run-build-exited-with-1

## Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)

```text
My Vercel build fails with the error below but works with npm run dev. Run the production build, fix every TypeScript and lint error properly (no ts-ignore or ignoreBuildErrors), fix any import path whose casing doesn't match the file name, and confirm npm run build passes. Error log: <PASTE LOG>
```

## FAQ

### Can I set ignoreBuildErrors?

It ships, but hides real bugs. Use it only as a temporary stopgap.

### Why does casing matter?

Vercel builds on Linux, which has a case-sensitive filesystem.

## Sources (official documentation)

- [Vercel: Troubleshoot a build](https://vercel.com/docs/deployments/troubleshoot-a-build)

## Related fixes

- [App works on localhost but breaks in production: a checklist to find the cause](https://unbreakmyapp.vercel.app/fixes/works-on-localhost-breaks-in-production.html)
- [404 NOT_FOUND when refreshing a page (React/Vite SPA)](https://unbreakmyapp.vercel.app/fixes/vercel-404-on-refresh-spa.html)
- [CORS error: blocked by CORS policy: No 'Access-Control-Allow-Origin' header](https://unbreakmyapp.vercel.app/fixes/cors-error-fetch-blocked.html)
- [Replit deploy: app not reachable / port not open](https://unbreakmyapp.vercel.app/fixes/replit-port-not-open.html)

---
Unbreak My App: free fixes for broken vibe-coded apps. https://unbreakmyapp.vercel.app/
