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
Paste what the compiler said
A build log, a terminal line, an editor tooltip — anything with a TS number in it. Matching happens in your browser. When there is no page for a code, that number alone is sent so we know what to write next; the message never leaves the tab.
- TS1015Question mark and default
Parameter cannot have question mark and initializer.A default value already makes a parameter optional, so the question mark is not merely redundant — it contradicts the guarantee the default is there to give.
- TS1107Jumping out of a callback
Jump target cannot cross function boundary.breakandcontinuesteer the loop they are written in. A callback is a different function, and that loop is not its to steer. - TS1109Expression expected
Expression expected.The parser reached a position where only a value may appear and found something that cannot start one — usually a line left half-written.
- TS1110A conditional with no else
Type expected.A conditional type must say what happens when the check fails. There is no optional else at the type level, because every type has to resolve to something.
- TS1196Typing a catch variable
Catch clause variable type annotation must be 'any' or 'unknown' if specified.JavaScript lets anything be thrown, so the compiler cannot promise that what lands in a catch clause is an
Error.unknownis the only honest annotation. - TS2300Duplicate identifier
Duplicate identifier 'Result'.The same non-mergeable type name was declared twice in one scope.
- 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.
- TS2312Interface cannot extend a union
An interface can only extend an object type or intersection of object types with statically known members.An interface tried to inherit from a union whose members are not all known at once.
- TS2314Generic type needs type arguments
Generic type 'Box' requires 1 type argument(s).A generic alias was used without supplying the type parameter it requires.
- TS2315Type is not generic
Type 'Label' is not generic.Type arguments were supplied to an alias that declares no type parameters.
- 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.
- TS2349Expression is not callable
This expression is not callable.Parentheses are being used as a function call, but the expression has no call signature.
- TS2351Expression is not constructable
This expression is not constructable.The value after
newhas no construct signature, so it cannot create an instance. - TS2352Suspicious type conversion
Conversion of type 'string' to type 'number' may be a mistake because neither type sufficiently overlaps with the other.A type assertion jumps between unrelated types and would not perform the runtime conversion its spelling suggests.
- 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.
- TS2393Duplicate function implementation
Duplicate function implementation.Two function bodies share one name in the same scope; overloads may have many signatures but only one implementation.
- 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
implementsand 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
undefinedyou find out about later. - TS2532Object is possibly undefined
Object is possibly 'undefined'.A property is read directly from an expression whose result may be
undefined. - 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.
- TS2554Wrong number of arguments
Expected 2 arguments, but got 1.The selected call signature requires more arguments than this call supplies.
- 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
undefinedin 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.
- TS2693Type used as a runtime value
'User' only refers to a type, but is being used as a value here.A type alias was referenced in value space, but aliases are erased from the emitted JavaScript.
- TS2739Object is missing required properties
Type '{}' is missing the following properties from type 'Point': x, yThe target type requires several members, and the supplied object has none of them.
- 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.
- TS2749Value used as a type
'widget' refers to a value, but is being used as a type here. Did you mean 'typeof widget'?A runtime variable was written in type space; use
typeofto ask for the type of that value. - 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.
- TS5055Emitting over your own source
Cannot write file 'src/app.js' because it would overwrite input file.With
allowJson, a.jsfile is both an input and the name of an output. If the output goes where the input lives, the compiler would overwrite the file it just read. - TS7006Parameter implicitly has an any type
Parameter 'value' implicitly has an 'any' type.Strict mode found a function parameter with no annotation and no surrounding context from which to infer one.
- TS7015Array indexed with a non-number
Element implicitly has an 'any' type because index expression is not of type 'number'.Arrays describe numeric positions; a string key such as
firstis not one of those positions. - TS7023Recursive return type cannot be inferred
'factorial' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.A recursive function asks inference to know its return type before that same return type has been established.
- TS7031Destructured value implicitly has any
Binding element 'name' implicitly has an 'any' type.A destructuring pattern names a field, but the object containing that field has no known type.
- 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 beany, andstrictwill not allow that quietly. - TS18046It is unknown
'value' is of type 'unknown'.unknownis the type that refuses to be used until you prove what it is. That refusal is the entire feature. - TS18047Value is possibly null
'value' is possibly 'null'.A nullable value is used as though the
nullbranch had already been ruled out. - 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.

