Errors/TypeScript

Common TypeScript Errors

TypeScript compilation errors including type mismatches, generics, module resolution, and strict mode issues.

99 errors documented with step-by-step fixes

Type not assignable TypeScript TS2322

TS2322: Type 'string' is not assignable to type 'number'

You assigned a value of the wrong type to a variable.

Argument type not assignable TypeScript TS2345

TS2345: Argument of type 'string' is not assignable

A function argument has the wrong type.

Property does not exist TypeScript TS2339

TS2339: Property does not exist on type

You're accessing a property that TypeScript doesn't know about.

Object possibly undefined TypeScript TS2532

TS2532: Object is possibly 'undefined'

A value might be undefined and you're using it without checking.

Object possibly null TypeScript TS2531

TS2531: Object is possibly 'null'

A value might be null and you're accessing properties on it.

Cannot find module TypeScript TS2307

TS2307: Cannot find module

TypeScript can't find the module or its type declarations.

Cannot find name TypeScript TS2304

TS2304: Cannot find name

A global name or type isn't recognized.

Property missing in type TypeScript TS2741

TS2741: Property is missing in type

An object is missing required properties from its interface.

Wrong number of arguments TypeScript TS2554

TS2554: Expected N arguments, but got M

A function was called with the wrong number of arguments.

No overload matches TypeScript TS2769

TS2769: No overload matches this call

None of the function overloads match the provided arguments.

Implicit any type TypeScript TS7006

TS7006: Parameter implicitly has an 'any' type

A parameter doesn't have a type annotation in strict mode.

Semicolon expected TypeScript TS1005

TS1005: ';' expected

A syntax error, usually from JavaScript-only syntax in a .ts file.

Cannot invoke expression TypeScript TS2349

TS2349: Cannot invoke expression with no call signature

You tried to call something TypeScript doesn't recognize as callable.

No properties in common TypeScript TS2559

TS2559: Type has no properties in common

Two types have zero overlapping properties.

Type unknown TypeScript TS18046

TS18046: 'x' is of type 'unknown'

You need to narrow an unknown type before using it.

Arithmetic operand must be number TypeScript

TS2363: Right side of arithmetic must be number

You used a non-number in an arithmetic expression.

Spread types error TypeScript TS2698

TS2698: Spread types only from known properties

TypeScript can't verify the spread object has the right shape.

Property not assignable to base TypeScript TS2416

TS2416: Property in type is not assignable to same in base

A class property doesn't match the parent class or interface.

Property no initializer TypeScript TS2564

TS2564: Property has no initializer

A class property isn't initialized in strict mode.

Cannot find type definition TypeScript TS2688

TS2688: Cannot find type definition file

A @types package reference can't be found.

TS2322: Type 'null' is not assignable to type 'string' in TypeScript

TS2322: Type 'null' is not assignable to type 'string'

This TypeScript error occurs when type 'null' is not assignable to type 'string'. Check the stack trace for the exact location and fix the root cause.

TS2322: Type 'undefined' is not assignable in TypeScript

TS2322: Type 'undefined' is not assignable

This TypeScript error occurs when type 'undefined' is not assignable. Check the stack trace for the exact location and fix the root cause.

TS2322: Type 'string | undefined' is not assignable to type in TypeScript

TS2322: Type 'string | undefined' is not assignable to type 'string'

This TypeScript error occurs when type 'string | undefined' is not assignable to type 'string'. Check the stack trace for the exact location and fix the root cause.

TS2322: Type 'number' is not assignable to type 'string' in TypeScript

TS2322: Type 'number' is not assignable to type 'string'

This TypeScript error occurs when type 'number' is not assignable to type 'string'. Check the stack trace for the exact location and fix the root cause.

TS2322: Type 'any[]' is not assignable in TypeScript

TS2322: Type 'any[]' is not assignable

This TypeScript error occurs when type 'any[]' is not assignable. Check the stack trace for the exact location and fix the root cause.

TS2345: Argument type 'null' is not assignable in TypeScript

TS2345: Argument type 'null' is not assignable

This TypeScript error occurs when argument type 'null' is not assignable. Check the stack trace for the exact location and fix the root cause.

TS2345: Argument type 'undefined' is not assignable in TypeScript

TS2345: Argument type 'undefined' is not assignable

This TypeScript error occurs when argument type 'undefined' is not assignable. Check the stack trace for the exact location and fix the root cause.

TS2345: Argument type 'string | null' is not assignable in TypeScript

TS2345: Argument type 'string | null' is not assignable

This TypeScript error occurs when argument type 'string | null' is not assignable. Check the stack trace for the exact location and fix the root cause.

TS2339: Property 'x' does not exist on type 'object' in TypeScript

TS2339: Property 'x' does not exist on type 'object'

This TypeScript error occurs when property 'x' does not exist on type 'object'. Check the stack trace for the exact location and fix the root cause.

TS2339: Property 'x' does not exist on type '{}' in TypeScript

TS2339: Property 'x' does not exist on type '{}'

This TypeScript error occurs when property 'x' does not exist on type '{}'. Check the stack trace for the exact location and fix the root cause.

TS2339: Property 'x' does not exist on type 'never' in TypeScript

TS2339: Property 'x' does not exist on type 'never'

This TypeScript error occurs when property 'x' does not exist on type 'never'. Check the stack trace for the exact location and fix the root cause.

TS2339: Property 'x' does not exist on type 'unknown' in TypeScript

TS2339: Property 'x' does not exist on type 'unknown'

This TypeScript error occurs when property 'x' does not exist on type 'unknown'. Check the stack trace for the exact location and fix the root cause.

TS2551: Property 'x' does not exist. Did you mean 'y'? in TypeScript

TS2551: Property 'x' does not exist. Did you mean 'y'?

This TypeScript error occurs when property 'x' does not exist. did you mean 'y'?. Check the stack trace for the exact location and fix the root cause.

TS2740: Type is missing properties from type in TypeScript

TS2740: Type is missing properties from type

This TypeScript error occurs when type is missing properties from type. Check the stack trace for the exact location and fix the root cause.

TS2741: Property 'x' is missing in type but required in TypeScript

TS2741: Property 'x' is missing in type but required

This TypeScript error occurs when property 'x' is missing in type but required. Check the stack trace for the exact location and fix the root cause.

TS2742: Inferred type cannot be named in TypeScript

TS2742: Inferred type cannot be named

This TypeScript error occurs when inferred type cannot be named. Check the stack trace for the exact location and fix the root cause.

TS2344: Type does not satisfy constraint in TypeScript

TS2344: Type does not satisfy constraint

This TypeScript error occurs when type does not satisfy constraint. Check the stack trace for the exact location and fix the root cause.

TS2314: Type argument not assignable to constraint in TypeScript

TS2314: Type argument not assignable to constraint

This TypeScript error occurs when type argument not assignable to constraint. Check the stack trace for the exact location and fix the root cause.

TS2590: Expression produces a union type that is too complex in TypeScript

TS2590: Expression produces a union type that is too complex

This TypeScript error occurs when expression produces a union type that is too complex. Check the stack trace for the exact location and fix the root cause.

TS2589: Type instantiation is excessively deep in TypeScript

TS2589: Type instantiation is excessively deep

This TypeScript error occurs when type instantiation is excessively deep. Check the stack trace for the exact location and fix the root cause.

TS2307: Cannot find module 'react' in TypeScript

TS2307: Cannot find module 'react'

This TypeScript error occurs when cannot find module 'react'. Check the stack trace for the exact location and fix the root cause.

TS2307: Cannot find module '*.css' in TypeScript

TS2307: Cannot find module '*.css'

This TypeScript error occurs when cannot find module '*.css'. Check the stack trace for the exact location and fix the root cause.

TS2307: Cannot find module '*.svg' in TypeScript

TS2307: Cannot find module '*.svg'

This TypeScript error occurs when cannot find module '*.svg'. Check the stack trace for the exact location and fix the root cause.

TS2307: Cannot find module '*.png' in TypeScript

TS2307: Cannot find module '*.png'

This TypeScript error occurs when cannot find module '*.png'. Check the stack trace for the exact location and fix the root cause.

TS2307: Cannot find module '.env' in TypeScript

TS2307: Cannot find module '.env'

This TypeScript error occurs when cannot find module '.env'. Check the stack trace for the exact location and fix the root cause.

TS2305: Module has no exported member in TypeScript

TS2305: Module has no exported member

This TypeScript error occurs when module has no exported member. Check the stack trace for the exact location and fix the root cause.

TS2497: Module can only be default-imported in TypeScript

TS2497: Module can only be default-imported

This TypeScript error occurs when module can only be default-imported. Check the stack trace for the exact location and fix the root cause.

TS1259: Module can only be referenced with ECMAScript import in TypeScript

TS1259: Module can only be referenced with ECMAScript import

This TypeScript error occurs when module can only be referenced with ecmascript import. Check the stack trace for the exact location and fix the root cause.

TS2354: This syntax requires an imported helper in TypeScript

TS2354: This syntax requires an imported helper

This TypeScript error occurs when this syntax requires an imported helper. Check the stack trace for the exact location and fix the root cause.

TS2556: Expected 0 type arguments, got 1 in TypeScript

TS2556: Expected 0 type arguments, got 1

This TypeScript error occurs when expected 0 type arguments, got 1. Check the stack trace for the exact location and fix the root cause.

TS2558: Expected 0 type arguments, got 2 in TypeScript

TS2558: Expected 0 type arguments, got 2

This TypeScript error occurs when expected 0 type arguments, got 2. Check the stack trace for the exact location and fix the root cause.

TS2554: Expected 0 arguments, but got 1 in TypeScript

TS2554: Expected 0 arguments, but got 1

This TypeScript error occurs when expected 0 arguments, but got 1. Check the stack trace for the exact location and fix the root cause.

TS2554: Expected 1 arguments, but got 0 in TypeScript

TS2554: Expected 1 arguments, but got 0

This TypeScript error occurs when expected 1 arguments, but got 0. Check the stack trace for the exact location and fix the root cause.

TS2554: Expected 2 arguments, but got 3 in TypeScript

TS2554: Expected 2 arguments, but got 3

This TypeScript error occurs when expected 2 arguments, but got 3. Check the stack trace for the exact location and fix the root cause.

TS2367: This comparison appears to be unintentional in TypeScript

TS2367: This comparison appears to be unintentional

This TypeScript error occurs when this comparison appears to be unintentional. Check the stack trace for the exact location and fix the root cause.

TS2365: Operator '+' cannot be applied to types in TypeScript

TS2365: Operator '+' cannot be applied to types

This TypeScript error occurs when operator '+' cannot be applied to types. Check the stack trace for the exact location and fix the root cause.

TS2362: The left-hand side of arithmetic operation must be n in TypeScript

TS2362: The left-hand side of arithmetic operation must be number

This TypeScript error occurs when the left-hand side of arithmetic operation must be number. Check the stack trace for the exact location and fix the root cause.

TS2571: Object is of type 'unknown' in TypeScript

TS2571: Object is of type 'unknown'

This TypeScript error occurs when object is of type 'unknown'. Check the stack trace for the exact location and fix the root cause.

TS2352: Conversion of type may be a mistake in TypeScript

TS2352: Conversion of type may be a mistake

This TypeScript error occurs when conversion of type may be a mistake. Check the stack trace for the exact location and fix the root cause.

TS2454: Variable is used before being assigned in TypeScript

TS2454: Variable is used before being assigned

This TypeScript error occurs when variable is used before being assigned. Check the stack trace for the exact location and fix the root cause.

TS2564: Property has no initializer and is not assigned in c in TypeScript

TS2564: Property has no initializer and is not assigned in constructor

This TypeScript error occurs when property has no initializer and is not assigned in constructor. Check the stack trace for the exact location and fix the root cause.

TS2565: Property is used before initialization in TypeScript

TS2565: Property is used before initialization

This TypeScript error occurs when property is used before initialization. Check the stack trace for the exact location and fix the root cause.

TS18048: Value is possibly undefined in TypeScript

TS18048: Value is possibly undefined

This TypeScript error occurs when value is possibly undefined. Check the stack trace for the exact location and fix the root cause.

TS18047: Value is possibly null in TypeScript

TS18047: Value is possibly null

This TypeScript error occurs when value is possibly null. Check the stack trace for the exact location and fix the root cause.

TS7053: Element implicitly has an 'any' type in TypeScript

TS7053: Element implicitly has an 'any' type

This TypeScript error occurs when element implicitly has an 'any' type. Check the stack trace for the exact location and fix the root cause.

TS7015: Element implicitly has an 'any' type because index e in TypeScript

TS7015: Element implicitly has an 'any' type because index expression is not number

This TypeScript error occurs when element implicitly has an 'any' type because index expression is not number. Check the stack trace for the exact location and fix the root cause.

TS7030: Not all code paths return a value in TypeScript

TS7030: Not all code paths return a value

This TypeScript error occurs when not all code paths return a value. Check the stack trace for the exact location and fix the root cause.

TS7031: Binding element implicitly has 'any' type in TypeScript

TS7031: Binding element implicitly has 'any' type

This TypeScript error occurs when binding element implicitly has 'any' type. Check the stack trace for the exact location and fix the root cause.

TS2420: Class incorrectly implements interface in TypeScript

TS2420: Class incorrectly implements interface

This TypeScript error occurs when class incorrectly implements interface. Check the stack trace for the exact location and fix the root cause.

TS2415: Class incorrectly extends base class in TypeScript

TS2415: Class incorrectly extends base class

This TypeScript error occurs when class incorrectly extends base class. Check the stack trace for the exact location and fix the root cause.

TS2355: A function whose declared type is not 'void' must re in TypeScript

TS2355: A function whose declared type is not 'void' must return a value

This TypeScript error occurs when a function whose declared type is not 'void' must return a value. Check the stack trace for the exact location and fix the root cause.

TS2366: Function lacks ending return statement in TypeScript

TS2366: Function lacks ending return statement

This TypeScript error occurs when function lacks ending return statement. Check the stack trace for the exact location and fix the root cause.

TS2394: Overload signature is not compatible with function i in TypeScript

TS2394: Overload signature is not compatible with function implementation

This TypeScript error occurs when overload signature is not compatible with function implementation. Check the stack trace for the exact location and fix the root cause.

TS2769: No overload matches this call (multiple overloads) in TypeScript

TS2769: No overload matches this call (multiple overloads)

This TypeScript error occurs when no overload matches this call (multiple overloads). Check the stack trace for the exact location and fix the root cause.

TS4058: Return type of exported function has or is using nam in TypeScript

TS4058: Return type of exported function has or is using name from external module

This TypeScript error occurs when return type of exported function has or is using name from external module. Check the stack trace for the exact location and fix the root cause.

TS4060: Return type of public method has or is using private in TypeScript

TS4060: Return type of public method has or is using private name

This TypeScript error occurs when return type of public method has or is using private name. Check the stack trace for the exact location and fix the root cause.

TS1005: ',' expected in TypeScript

TS1005: ',' expected

This TypeScript error occurs when ',' expected. Check the stack trace for the exact location and fix the root cause.

TS1003: Identifier expected in TypeScript

TS1003: Identifier expected

This TypeScript error occurs when identifier expected. Check the stack trace for the exact location and fix the root cause.

TS1109: Expression expected in TypeScript

TS1109: Expression expected

This TypeScript error occurs when expression expected. Check the stack trace for the exact location and fix the root cause.

TS1128: Declaration or statement expected in TypeScript

TS1128: Declaration or statement expected

This TypeScript error occurs when declaration or statement expected. Check the stack trace for the exact location and fix the root cause.

TS1192: Module has no default export in TypeScript

TS1192: Module has no default export

This TypeScript error occurs when module has no default export. Check the stack trace for the exact location and fix the root cause.

TS1202: Import assignment cannot be used with ECMAScript mod in TypeScript

TS1202: Import assignment cannot be used with ECMAScript modules

This TypeScript error occurs when import assignment cannot be used with ecmascript modules. Check the stack trace for the exact location and fix the root cause.

TS1205: Re-exporting a type when using isolatedModules in TypeScript

TS1205: Re-exporting a type when using isolatedModules

This TypeScript error occurs when re-exporting a type when using isolatedmodules. Check the stack trace for the exact location and fix the root cause.

TS1238: Unable to resolve signature of class decorator in TypeScript

TS1238: Unable to resolve signature of class decorator

This TypeScript error occurs when unable to resolve signature of class decorator. Check the stack trace for the exact location and fix the root cause.

TS1270: Decorator cannot be used on export declaration in th in TypeScript

TS1270: Decorator cannot be used on export declaration in this context

This TypeScript error occurs when decorator cannot be used on export declaration in this context. Check the stack trace for the exact location and fix the root cause.

TS2688: Cannot find type definition file for 'node' in TypeScript

TS2688: Cannot find type definition file for 'node'

This TypeScript error occurs when cannot find type definition file for 'node'. Check the stack trace for the exact location and fix the root cause.

TS2688: Cannot find type definition file for 'jest' in TypeScript

TS2688: Cannot find type definition file for 'jest'

This TypeScript error occurs when cannot find type definition file for 'jest'. Check the stack trace for the exact location and fix the root cause.

TS2688: Cannot find type definition file for 'mocha' in TypeScript

TS2688: Cannot find type definition file for 'mocha'

This TypeScript error occurs when cannot find type definition file for 'mocha'. Check the stack trace for the exact location and fix the root cause.

TS5023: Unknown compiler option in TypeScript

TS5023: Unknown compiler option

This TypeScript error occurs when unknown compiler option. Check the stack trace for the exact location and fix the root cause.

TS5024: Compiler option requires a value in TypeScript

TS5024: Compiler option requires a value

This TypeScript error occurs when compiler option requires a value. Check the stack trace for the exact location and fix the root cause.

TS5055: Cannot write file because it would overwrite input in TypeScript

TS5055: Cannot write file because it would overwrite input

This TypeScript error occurs when cannot write file because it would overwrite input. Check the stack trace for the exact location and fix the root cause.

TS6059: rootDir is expected to contain all source files in TypeScript

TS6059: rootDir is expected to contain all source files

This TypeScript error occurs when rootdir is expected to contain all source files. Check the stack trace for the exact location and fix the root cause.

TS6133: Variable is declared but never used in TypeScript

TS6133: Variable is declared but never used

This TypeScript error occurs when variable is declared but never used. Check the stack trace for the exact location and fix the root cause.

TS6196: Variable is declared but never read in TypeScript

TS6196: Variable is declared but never read

This TypeScript error occurs when variable is declared but never read. Check the stack trace for the exact location and fix the root cause.

TS18003: No inputs were found in config file in TypeScript

TS18003: No inputs were found in config file

This TypeScript error occurs when no inputs were found in config file. Check the stack trace for the exact location and fix the root cause.

TS6305: Output file has not been built from source in TypeScript

TS6305: Output file has not been built from source

This TypeScript error occurs when output file has not been built from source. Check the stack trace for the exact location and fix the root cause.

TS2786: Component cannot be used as a JSX component in TypeScript

TS2786: Component cannot be used as a JSX component

This TypeScript error occurs when component cannot be used as a jsx component. Check the stack trace for the exact location and fix the root cause.

TS2604: JSX element type does not have construct or call sig in TypeScript

TS2604: JSX element type does not have construct or call signatures

This TypeScript error occurs when jsx element type does not have construct or call signatures. Check the stack trace for the exact location and fix the root cause.

TS17004: Cannot use JSX unless the '--jsx' flag is provided in TypeScript

TS17004: Cannot use JSX unless the '--jsx' flag is provided

This TypeScript error occurs when cannot use jsx unless the '--jsx' flag is provided. Check the stack trace for the exact location and fix the root cause.

Bugsly catches TypeScript errors automatically

AI-powered error tracking that explains what went wrong and suggests fixes. Set up in 2 minutes.

Get Started Free