# Your app runs fine with npm run dev, but the deploy fails with TypeScript errors

- Fix ID: APP-16
- Exact error: `error TS6133: 'count' is declared but its value is never read.`
- Status: Manually verified (CI: pending, no CI results exist yet)
- Last verified: 2026-10-26
- Platforms: Bolt, Lovable, Cursor, Netlify, Vercel
- Versions: os=Debian 13 (container); node=20.19.2; vite=8.3.5 (react-ts template, strict, noUnusedLocals); browser=Headless Chrome 156
- Repro: https://stucktoshipped.com/repros/APP-16/ (file hashes only; files are in the paid repro bundle)
- Canonical: https://stucktoshipped.com/fixes/vite/typescript-errors-fail-build-dev-works/

## In brief
The dev server skips type-checking; the production build doesn't. The full fix shows how to see every error locally in one pass, fix them, and why turning the check off is a trap.

## Symptom
Your Bolt, Lovable or Cursor app works in the preview, or with `npm run dev`. Then Netlify or Vercel fails the build with lines like:

```
src/App.tsx(5,10): error TS6133: 'count' is declared but its value is never read.
src/App.tsx(7,20): error TS2322: Type '{ id: string; name: string; }' is not assignable to type 'User'.
```
Next.js apps show the same thing as `Type error: ...` and `Failed to compile`.

## Why it happens
- **The dev server only translates your code; it doesn't type-check it.** So mistakes the AI left behind don't stop the preview.
- **The production build starts with a strict TypeScript check.** In the standard Vite template, `npm run build` runs `tsc -b && vite build`.
- **Common leftovers it catches:** unused variables, wrong types (a string where a number is expected), and missing properties.

## What we could not test
- Netlify, Vercel or Bolt's deploy pipeline.
- Next.js's type-check step.
- Projects with other `tsconfig` strictness settings.

## Full fix (paid)
The step-by-step fix, commands and test record are paid content and are not in this file. Price: $4 per fix (planned launch price; checkout not open yet). SHA-256 of the full fix: ae595970ea3cec274438ab9c87caa2241dbb6e7cc08ca6ccc1ab7132ba258ad8. How to buy: https://stucktoshipped.com/pricing/ and https://stucktoshipped.com/products.json

## Sources
- [r/boltnewbuilders: Netlify builds failing due to TypeScript errors](https://www.reddit.com/r/boltnewbuilders/comments/1hy1d9d/help_with_manual_deployment_netlify_builds/)
- [next.js discussion 24866: local builds succeed but Vercel build fails (Type error)](https://github.com/vercel/next.js/discussions/24866)
- [r/cursor: moving from dev environment to production build](https://www.reddit.com/r/cursor/comments/1hgmjl3/looking_for_help_moving_from_dev_environment_to/)

## How this page was made
Drafted by an AI agent and reproduced on our test machine on 2026-10-26. No warranty; test on a copy first.
