What it means
TypeScript checks your code for mistakes before it is built. In development, tools like next dev and vite dev skip or soften that check, so the app can run with errors. A production build treats type errors as failures. The build says the same: type errors fail the build even when the app runs locally with next dev.
How to fix it
-
Run the type check on your machine
Run
npx tsc --noEmit. It lists every type error with its file and line, without building anything. -
Fix each error
Ask your agent: "Fix all TypeScript errors that
npx tsc --noEmitreports." Fix the cause, not the symptom. -
Run the production build locally
Run
npm run build. When it passes locally, deploy again. A failed deploy never counts against your plan.
Errors you will often see
-
TS2307, Cannot find module. A path alias such as
@/lib/dbis not set intsconfig.json, the file does not exist, or a@typespackage is missing. -
TS7006, implicit any. A parameter has no type and
strictmode is on. -
TS6133, declared but never used. A variable or import is unused and
noUnusedLocalsis on. -
TS2322, type not assignable. A value does not match the type it is given.