Jay's blog

Typescript, Show Me The Whole Error!

Has this ever happened to you? Typescript throws an error about two types being incompatible, but the differing parts of the types is truncated from the error!

This is the default behavior for some reason. I'm not a fan. I know long error messages scare a lot of developers, but I'd rather have a long and helpful error message than a short and useless one.

Good news! Error message salvation is one tsconfig.json setting away. Set noErrorTruncation to false and you'll be all set.

Personally, I'd rather opt in to truncation than opt out, but at least it's an easy fix.

#typescript