Skip to content
Latchkey

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
====================================
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

  1. Run npx svelte-check locally to reproduce the exact list.
  2. Fix each error at the file and line it names.
  3. Re-run until it reports 0 errors.
Terminal
npx svelte-check --tsconfig ./tsconfig.json

Generate route types first

Run sync so $types exist before the check, otherwise generated-type imports fail.

Terminal
npx svelte-kit sync
npx svelte-check

How to prevent it

  • Run svelte-check locally and in a pre-push hook, not only in CI.
  • Run svelte-kit sync before checking so generated types exist.
  • Treat the checker as a gate; fix diagnostics rather than ignoring them.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →