Error map

TS2693: 'X' only refers to a type, but is being used as a value here TypeScript: error TS2693: 'User' only refers to a type, but is being used as a value here.

TypeScript · layer 1, On your device

Open the full error page →

Centre: this error. First ring: errors it is linked with (8). 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.

TS2693: 'X' only refers to a type, but is being used as a value here — TypeScript: error TS2693: 'User' only refers to a type, but is being used as a value here. (TypeScript)TS2693: 'X'…TS2304 — TS2304: Cannot find name 'x'. (Node.js)TS2304TS1208: File cannot be compiled under '--isolatedModules' because it is considered a global script file — TypeScript: error TS1208: 'index.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement (TypeScript)TS1208: File cannot…TS2349: This expression is not callable — TypeScript: error TS2349: This expression is not callable. Type 'X' has no call signatures. (TypeScript)TS2349: This expres…TS1192: Module has no default export — TypeScript: error TS1192: Module '"./utils"' has no default export. (TypeScript)TS1192: Module has …TS1484/TS1205: type must be imported using a type-only import — TypeScript: error TS1484: 'User' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. (TypeScript)TS1484/TS1205: type…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…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 …ReferenceError — ReferenceError: x is not defined (JavaScript)ReferenceErrorClassCastException — java.lang.ClassCastException: class A cannot be cast to class B (Java)ClassCastExceptionERR_INVALID_ARG_TYPE — TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined (Node.js)ERR_INVALID_ARG_TYPEERR_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 importERR_IMPORT_ATTRIBUTE_MISSING — TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module needs an import attribute of "type: json" (Node.js)ERR_IMPORT_ATTRIBUT…TS2366: Function lacks ending return statement — TypeScript: error TS2366: Function lacks ending return statement and return type does not include 'undefined'. (TypeScript)TS2366: Function la…TS2393: Duplicate function implementation — TypeScript: error TS2393: Duplicate function implementation. (TypeScript)TS2393: Duplicate f…TS2554: Expected N arguments, but got M — TypeScript: error TS2554: Expected 2 arguments, but got 1. (TypeScript)TS2554: Expected N …TypeError: not a function — TypeError: x is not a function (JavaScript)TypeError: not a fu…not a constructor — TypeError: x is not a constructor (JavaScript)not a constructorTDZ — ReferenceError: Cannot access 'x' before initialization (JavaScript)TDZRouter.use middleware — TypeError: Router.use() requires a middleware function but got a Object (Node.js)Router.use middlewa…Element type is invalid — Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined (React)Element type is inv…Module not found: Can't resolve 'x' (Next.js build) — Next.js: Module not found: Can't resolve '@/components/Button' / 'lodash' in '/app/src' (Next.js)Module not found: C…Unexpected 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 )already declared — SyntaxError: Identifier 'x' has already been declared (JavaScript)already declaredawait 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…ERR_UNKNOWN_FILE_EXTENSION — TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" (Node.js)ERR_UNKNOWN_FILE_EX…TS2307 — TS2307: Cannot find module 'x' or its corresponding type declarations. (Node.js)TS2307TS7016 — TS7016: Could not find a declaration file for module 'x'. 'x.js' implicitly has an 'any' type. (Node.js)TS7016

Directly related (8)

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.

TS1208: File cannot be compiled under '--isolatedModules' because it is considered a global script fileTypeScript

TypeScript: error TS1208: 'index.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement

With `isolatedModules`, every file must be a module (have an import or export).

TS2349: This expression is not callableTypeScript

TypeScript: error TS2349: This expression is not callable. Type 'X' has no call signatures.

You called something TypeScript believes isn't a function (a union without compatible signatures, a module namespace, an object).

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.

TS1484/TS1205: type must be imported using a type-only importTypeScript

TypeScript: error TS1484: 'User' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

With `verbatimModuleSyntax` or `isolatedModules`, types must be imported/re-exported with `import type` / `export type`.

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…

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 (24)

ReferenceErrorJavaScript

ReferenceError: x is not defined

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

ClassCastExceptionJava

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

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

ERR_INVALID_ARG_TYPENode.js

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

A Node API got an argument of the wrong type — usually undefined because an env var or config value is missing.

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"…

ERR_IMPORT_ATTRIBUTE_MISSINGNode.js

TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module needs an import attribute of "type: json"

An ES module imported a .json file without the required import attribute.

TS2366: Function lacks ending return statementTypeScript

TypeScript: error TS2366: Function lacks ending return statement and return type does not include 'undefined'.

A function with a declared return type can reach its end without returning on some path.

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.

TS2554: Expected N arguments, but got MTypeScript

TypeScript: error TS2554: Expected 2 arguments, but got 1.

A call passes too few or too many arguments.

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…).

not a constructorJavaScript

TypeError: x is not a constructor

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

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.

Router.use middlewareNode.js

TypeError: Router.use() requires a middleware function but got a Object

app.use()/router.use() received an object instead of a function — usually a router module that wasn’t exported.

Element type is invalidReact

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined

JSX referenced a component that is undefined — almost always a default/named import mismatch.

Module not found: Can't resolve 'x' (Next.js build)Next.js

Next.js: Module not found: Can't resolve '@/components/Button' / 'lodash' in '/app/src'

Webpack/Turbopack couldn't resolve an import — wrong path/alias, missing dependency or case mismatch.

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.

already declaredJavaScript

SyntaxError: Identifier 'x' has already been declared

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

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.

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.

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.

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.