New series: what assistive tech really hears on your checkout page. Start with part one →
Shipwright
Home
TypeScript May 25, 2026 1 min read 266 views

Error Messages from the TypeScript Compiler, Annotated

June Park

June Park

@junepark

Share
Cover illustration for the article Error Messages from the TypeScript Compiler, Annotated

Six confusing compiler errors and what each one is really telling you. TypeScript is at its best when you barely notice it. The goal of this post is fewer annotations, not more, while catching the bugs that actually reach production.

TS2322: not assignable
TS2322: not assignable
TS2345 with a generic argument
TS2345 with a generic argument
TS7053 on an index signature
TS7053 on an index signature
TS2589: instantiation too deep
TS2589: instantiation too deep
TS18048: possibly undefined
TS18048: possibly undefined
TS2769: no overload matches
TS2769: no overload matches

Reading the compiler’s mind

Inference covers most local code. Annotate function parameters and public return types, and let the compiler fill in everything else. If you find yourself writing as, stop and ask which check is missing.

We have been running this approach for several months now. The initial setup took about a day, and the ongoing cost is close to zero once the team knows where to look.

What we would change next time

Questions, corrections, and war stories are welcome in the comments. Several of our best follow-up posts started as a reader pointing out something we had missed.

  • Annotate parameters and exported return types.
  • Validate external data once, at the edge.
  • Prefer discriminated unions over optional flags.
  • Treat every as cast as a code smell to review.
June Park

June Park

Author

Frontend engineer working across React and TypeScript. June writes the posts she wishes she had found while debugging.

Related Posts

Comments 8

Oskar Nilsson

This finally clicked for me after reading the docs three times.

Amara Nwosu

Tried it on a side project over the weekend and it worked first time, which never happens.

Hannah Becker

Is there a repo with the full example? Happy to open a PR with a TypeScript version.

Liam O’Brien

Came for the snippet, stayed for the explanation.

Fatima Zahra

Solid write-up. The warning about caching bit us hard last year.

Mara Okafor Member

Glad it helped!

Hannah Becker

How does this hold up on older Safari versions? That is where we always get burned.

June Park Author

Clear, practical, no fluff. More of this, please.

Leave a comment

Your email will not be published. Sign in for a faster experience.

Supports **bold**, *italic*, and `code`.