Errors
One page per diagnostic. Each carries a reproduction that really does emit that code, and fixes that really do compile — both checked by the build, not by us.
Every reproduction and every fix on these pages is compiled at build time
- TS2304Cannot find name
Cannot find name 'Missing'.The compiler looked for this name in every scope it can see and found nothing. Usually a typo, an unimported type, or a value being used where a type belongs.
- TS2322Not assignable
Type 'number' is not assignable to type 'string'.The most common error TypeScript has. A value of one type was put where another was required, and the two are not compatible in that direction.
- TS2339No such property
Property 'b' does not exist on type '{ a: number; }'.You reached for a property the type does not have. Often the type is right and the spelling is wrong; sometimes the type is narrower than the value really is.
- TS2344Does not satisfy the constraint
Type 'number' does not satisfy the constraint 'string'.A type argument was rejected at the door. The generic said what it would accept, and this is not it.
- TS2345Wrong argument type
Argument of type 'number' is not assignable to parameter of type 'string'.The same assignability failure as TS2322, at a call site. A separate code because the fix is almost always in a different place.
- TS2355Must return a value
A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.The signature promises something comes back and the body never delivers it.
- TS2367Comparison with no overlap
This comparison appears to be unintentional because the types 'string' and 'number' have no overlap.The two sides can never be equal, so the comparison is always false and the compiler assumes you did not mean to write it.
- TS2416Member does not match the base
Property 'm' in type 'K' is not assignable to the same property in base type 'I'.…The member exists, which is why this is not TS2420 — but its type is not compatible with the one the base declared.
- TS2420Class does not implement its interface
Class 'L' incorrectly implements interface 'J'.…The class said `implements` and then did not. The detail underneath names exactly what is missing or mismatched.
- TS2456Circular type alias
Type alias 'Loop' circularly references itself.The alias is defined in terms of itself with nothing in between, so there is no point at which it means anything.
- TS2493Past the end of the tuple
Tuple type 'Pair' of length '2' has no element at index '2'.A tuple knows exactly how long it is, so indexing past the end is a compile-time error rather than an `undefined` you find out about later.
- TS2536Cannot be used to index
Type 'K' cannot be used to index type 'T'.You indexed a type parameter with another type parameter, and the compiler has no reason to believe the key exists.
- TS2540Read-only property
Cannot assign to 'x' because it is a read-only property.The property is marked `readonly`, which is a compile-time promise not to reassign it — and nothing more than that.
- TS2542Read-only index signature
Index signature in type '{ readonly [k: string]: number; }' only permits reading.The object accepts any string key, and every one of them is read-only. This is TS2540 applied to a whole family of keys at once.
- TS2564Property never assigned
Property 'x' has no initializer and is not definitely assigned in the constructor.The class declares a property that is never given a value, so every instance would start out with `undefined` in a slot the type says is always a number.
- TS2578The error you expected is gone
Unused '@ts-expect-error' directive.You told the compiler the next line would fail, and it did not. That is good news reported as an error, and it is exactly what the directive is for.
- TS2589Excessively deep
Type instantiation is excessively deep and possibly infinite.A recursive type went further than the compiler is willing to follow — usually around fifty levels, and almost always because the recursion is counting rather than shrinking.
- TS2741A required property is missing
Property 'b' is missing in type '{ a: number; }' but required in type 'Need'.The object is the right shape as far as it goes — it just does not go far enough. Every property the target requires must be present.
- TS2769No overload matches
No overload matches this call.The function has several signatures and the arguments fit none of them. The compiler then reports every attempt, which is why this error is so long.
- TS7053Implicit any from a string index
Element implicitly has an 'any' type because expression of type 'string' can't be used to index typeYou indexed an object with a plain `string`, and the compiler cannot tell which property you meant — so the result would be `any`, and `strict` will not allow that quietly.
- TS18046It is unknown
'value' is of type 'unknown'.`unknown` is the type that refuses to be used until you prove what it is. That refusal is the entire feature.
- TS18048Possibly undefined
'maybe.a' is possibly 'undefined'.An optional property was used without checking it. Under `strictNullChecks`, "optional" means the absence is part of the type and has to be handled.