Skip to content
Latchkey

Type checking is slow in CI (tsc)

tsc --noEmit takes minutes in CI, dominating pipeline time even when it ultimately passes.

What this error means

The type-check job is consistently one of the slowest steps, scaling with project size and re-checking everything each run.

tsc --extendedDiagnostics
Files:          4821
Lines:        912340
Check time:   142.6s
Total time:   168.9s

Common causes

How to fix it

Enable incremental and skipLibCheck

  1. Turn on incremental so unchanged files are skipped
  2. Set skipLibCheck to avoid checking dependency .d.ts files
tsconfig.json
{
  "compilerOptions": {
    "incremental": true,
    "skipLibCheck": true
  }
}

Split with project references and cache

  1. Use tsc --build with project references so only changed projects re-check
  2. Cache .tsbuildinfo and node_modules between runs
shell
npx tsc --build --incremental

How to prevent it

  • Keep incremental + skipLibCheck on, split large codebases with project references, and cache build artifacts. Faster managed runners (Latchkey) with more RAM and dependency caching cut tsc wall-clock time substantially.

Frequently asked questions

What causes "tsc type-checking is slow"?
The type-check job is consistently one of the slowest steps, scaling with project size and re-checking everything each run.
How do I fix tsc type-checking is slow?
Enable incremental and skipLibCheck

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card