svelte-check "found N errors" fails the build in CI
svelte-check ran the TypeScript and Svelte compiler diagnostics across your components and found errors, so it exits non-zero and fails the job. The summary line counts errors, warnings, and files checked.
What this error means
A svelte-check step ends with "svelte-check found N errors and M warnings" and exit code 1, while npm run dev shows nothing because the editor uses cached types.
====================================
svelte-check found 3 errors and 1 warning in 2 files
Error: Process completed with exit code 1.Common causes
Real type or template errors only caught by a clean run
svelte-check does a full, cold analysis. Property typos, wrong prop types, or missing imports surface here even when the dev server tolerated them.
Generated types are missing before the check
Without svelte-kit sync, the $types and route types are absent, so the checker reports cannot-find errors for them.
How to fix it
Read and fix each reported diagnostic
- Run
npx svelte-checklocally to reproduce the exact list. - Fix each error at the file and line it names.
- Re-run until it reports 0 errors.
npx svelte-check --tsconfig ./tsconfig.jsonGenerate route types first
Run sync so $types exist before the check, otherwise generated-type imports fail.
npx svelte-kit sync
npx svelte-checkHow to prevent it
- Run
svelte-checklocally and in a pre-push hook, not only in CI. - Run
svelte-kit syncbefore checking so generated types exist. - Treat the checker as a gate; fix diagnostics rather than ignoring them.