Error map

TS2403: Subsequent variable declarations must have the same type TypeScript: error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.

TypeScript · layer 1, On your device

Open the full error page →

Centre: this error. First ring: errors it is linked with (9). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

TS2403: Subsequent variable declarations must have the same type — TypeScript: error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. (TypeScript)TS2403: Sub…TypeError const — TypeError: Assignment to constant variable. (JavaScript)TypeError constTS2322 — TS2322: Type 'X' is not assignable to type 'Y' (TypeScript)TS2322TS2451: Cannot redeclare block-scoped variable — TypeScript: error TS2451: Cannot redeclare block-scoped variable 'name'. (TypeScript)TS2451: Cannot rede…TS2300: Duplicate identifier — TypeScript: error TS2300: Duplicate identifier 'Foo'. (TypeScript)TS2300: Duplicate i…TS1192: Module has no default export — TypeScript: error TS1192: Module '"./utils"' has no default export. (TypeScript)TS1192: Module has …TS1005: ';' expected / ',' expected (syntax error) — TypeScript: error TS1005: ';' expected. (TypeScript)TS1005: ';' expecte…TS1128: Declaration or statement expected — TypeScript: error TS1128: Declaration or statement expected. (TypeScript)TS1128: Declaration…TS4023/TS2742: exported variable has or is using name from external module but cannot be named — TypeScript: error TS4023: Exported variable 'x' has or is using name 'Foo' from external module "..." but cannot be named. / TS2742: The inferred type cannot be named without a reference (TypeScript)TS4023/TS2742: expo…Cannot find module './App.vue' or its corresponding type declarations — TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations. (Vue)Cannot find module …TypeError — TypeError: Cannot read properties of undefined (reading 'x') (JavaScript)TypeErrorTypeError: not a function — TypeError: x is not a function (JavaScript)TypeError: not a fu…ReferenceError — ReferenceError: x is not defined (JavaScript)ReferenceErrorAttributeError — AttributeError: 'X' object has no attribute 'y' (Python)AttributeErrorClassCastException — java.lang.ClassCastException: class A cannot be cast to class B (Java)ClassCastExceptionTS7016 — TS7016: Could not find a declaration file for module 'x'. 'x.js' implicitly has an 'any' type. (Node.js)TS7016already declared — SyntaxError: Identifier 'x' has already been declared (JavaScript)already declaredTDZ — ReferenceError: Cannot access 'x' before initialization (JavaScript)TDZTS2305: Module has no exported member — TypeScript: error TS2305: Module '"./utils"' has no exported member 'helper'. (TypeScript)TS2305: Module has …TS2304 — TS2304: Cannot find name 'x'. (Node.js)TS2304TS2393: Duplicate function implementation — TypeScript: error TS2393: Duplicate function implementation. (TypeScript)TS2393: Duplicate f…ERR_REQUIRE_ESM — Error [ERR_REQUIRE_ESM]: require() of ES Module not supported (Node.js)ERR_REQUIRE_ESMSyntaxError import — SyntaxError: Cannot use import statement outside a module (Node.js)SyntaxError importnot a constructor — TypeError: x is not a constructor (JavaScript)not a constructorUnexpected token < — SyntaxError: Unexpected token '<' (HTML served instead of JavaScript) (JavaScript)Unexpected token <unexpected end of input — SyntaxError: Unexpected end of input (JavaScript)unexpected end of i…missing ) — SyntaxError: missing ) after argument list (JavaScript)missing )await outside async — SyntaxError: await is only valid in async functions and the top level bodies of modules (JavaScript)await outside asyncunexpected identifier — SyntaxError: Unexpected identifier (JavaScript)unexpected identifi…invalid token — SyntaxError: Invalid or unexpected token (JavaScript)invalid tokenTS2307 — TS2307: Cannot find module 'x' or its corresponding type declarations. (Node.js)TS2307TS2502/TS7022: referenced directly or indirectly in its own initializer — TypeScript: error TS7022: 'x' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer (TypeScript)TS2502/TS7022: refe…TS2589: Type instantiation is excessively deep and possibly infinite — TypeScript: error TS2589: Type instantiation is excessively deep and possibly infinite. (TypeScript)TS2589: Type instan…ERR_UNKNOWN_FILE_EXTENSION — TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" (Node.js)ERR_UNKNOWN_FILE_EX…TS2339 — TS2339: Property 'x' does not exist on type 'Y'. (Node.js)TS2339TS2345 — TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. (Node.js)TS2345

Directly related (9)

TypeError constJavaScript

TypeError: Assignment to constant variable.

Code reassigned a variable declared with const.

TS2322TypeScript

TS2322: Type 'X' is not assignable to type 'Y'

You assigned a value whose type doesn’t match the declared type of the variable, property or return value.

TS2451: Cannot redeclare block-scoped variableTypeScript

TypeScript: error TS2451: Cannot redeclare block-scoped variable 'name'.

A `let`/`const`/`class` name was declared twice in the same scope — often because files are global scripts sharing one scope.

TS2300: Duplicate identifierTypeScript

TypeScript: error TS2300: Duplicate identifier 'Foo'.

The same name is declared twice in the same scope (or in merged global declarations).

TS1192: Module has no default exportTypeScript

TypeScript: error TS1192: Module '"./utils"' has no default export.

You used `import x from "./mod"` but the module only has named exports.

TS1005: ';' expected / ',' expected (syntax error)TypeScript

TypeScript: error TS1005: ';' expected.

The parser hit a syntax error — missing punctuation, mismatched brackets, or an unsupported syntax for your TypeScript version.

TS1128: Declaration or statement expectedTypeScript

TypeScript: error TS1128: Declaration or statement expected.

The parser found a token where a declaration or statement should start — usually stray braces/parentheses or code outside a funct…

TS4023/TS2742: exported variable has or is using name from external module but cannot be namedTypeScript

TypeScript: error TS4023: Exported variable 'x' has or is using name 'Foo' from external module "..." but cannot be named. / TS2742: The inferred type cannot be named without a reference

With `declaration: true`, TypeScript can't write the inferred type into `.d.ts` because it refers to a type it can't import by na…

Cannot find module './App.vue' or its corresponding type declarationsVue

TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations.

TypeScript doesn't know what a `.vue` import is without a shim or Volar/`vue-tsc`.

Two steps away (26)

TypeErrorJavaScript

TypeError: Cannot read properties of undefined (reading 'x')

You tried to access a property on a value that is `undefined` (or `null`) — usually data that hasn’t loaded yet or a wrong proper…

TypeError: not a functionJavaScript

TypeError: x is not a function

You called something as a function, but its value is not a function (it’s undefined, a string, an object…).

ReferenceErrorJavaScript

ReferenceError: x is not defined

Code refers to a variable or function name that doesn’t exist in the current scope.

AttributeErrorPython

AttributeError: 'X' object has no attribute 'y'

You accessed an attribute or method that doesn’t exist on that object type.

ClassCastExceptionJava

java.lang.ClassCastException: class A cannot be cast to class B

An object was cast to a type it isn’t.

TS7016Node.js

TS7016: Could not find a declaration file for module 'x'. 'x.js' implicitly has an 'any' type.

The JavaScript package has no TypeScript types bundled and no @types package installed.

already declaredJavaScript

SyntaxError: Identifier 'x' has already been declared

The same let/const/class name was declared twice in the same scope.

TDZJavaScript

ReferenceError: Cannot access 'x' before initialization

A let/const/class was used before its declaration line ran (temporal dead zone) — often a circular import.

TS2305: Module has no exported memberTypeScript

TypeScript: error TS2305: Module '"./utils"' has no exported member 'helper'.

You imported a named export that the module doesn't export.

TS2304Node.js

TS2304: Cannot find name 'x'.

TypeScript doesn’t know an identifier — a missing import, missing type definitions (e.g. for Node or Jest globals), or a typo.

TS2393: Duplicate function implementationTypeScript

TypeScript: error TS2393: Duplicate function implementation.

A function with the same name/signature is implemented more than once in the same scope.

ERR_REQUIRE_ESMNode.js

Error [ERR_REQUIRE_ESM]: require() of ES Module not supported

CommonJS code used `require()` on a package that is ES-module-only (node-fetch 3, chalk 5, nanoid 4, got 12…).

SyntaxError importNode.js

SyntaxError: Cannot use import statement outside a module

An `import` statement ran in a context treated as CommonJS (Node without "type": "module", a browser script without type="module"…

not a constructorJavaScript

TypeError: x is not a constructor

new was used with something that isn’t a class/constructor — usually a wrong import.

Unexpected token <JavaScript

SyntaxError: Unexpected token '<' (HTML served instead of JavaScript)

The browser loaded a .js file but received HTML (an error page or the SPA index.html).

unexpected end of inputJavaScript

SyntaxError: Unexpected end of input

The parser reached the end of the code (or JSON) while still expecting more — a missing } ) ] or empty JSON.

missing )JavaScript

SyntaxError: missing ) after argument list

A function call’s parentheses are unbalanced — often an unescaped quote or a missing comma/plus.

await outside asyncJavaScript

SyntaxError: await is only valid in async functions and the top level bodies of modules

await was used inside a function that isn’t async (or in a classic, non-module script).

unexpected identifierJavaScript

SyntaxError: Unexpected identifier

The parser found a name where it expected punctuation — usually a missing comma, operator or quote.

invalid tokenJavaScript

SyntaxError: Invalid or unexpected token

The code contains a character the parser can’t handle — smart quotes, stray characters or an unterminated string.

TS2307Node.js

TS2307: Cannot find module 'x' or its corresponding type declarations.

TypeScript can’t resolve the import — the package isn’t installed, the path alias isn’t configured, or there are no types.

TS2502/TS7022: referenced directly or indirectly in its own initializerTypeScript

TypeScript: error TS7022: 'x' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer

A variable's inferred type depends on itself (circular inference).

TS2589: Type instantiation is excessively deep and possibly infiniteTypeScript

TypeScript: error TS2589: Type instantiation is excessively deep and possibly infinite.

The compiler hit its recursion limit while evaluating a very complex or recursive generic type.

ERR_UNKNOWN_FILE_EXTENSIONNode.js

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"

Node tried to run a TypeScript file as ESM without a TypeScript loader.

TS2339Node.js

TS2339: Property 'x' does not exist on type 'Y'.

TypeScript’s type for the object doesn’t include that property.

TS2345Node.js

TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

A value’s type doesn’t match the function parameter — commonly a possibly-undefined value passed where a definite one is required.