Error map
TS2307 TS2307: Cannot find module 'x' or its corresponding type declarations.
Node.js · layer 4, Application & API
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.
Directly related (8)
Error: Cannot find module 'x' (MODULE_NOT_FOUND)
Node can’t resolve the module path — the package isn’t installed, or a relative path/extension is wrong.
TS18048: 'x' is possibly 'undefined'. (TS2532: Object is possibly 'undefined'.)
TypeScript requires you to handle the case where a value may be undefined before using it.
TS2339: Property 'x' does not exist on type 'Y'.
TypeScript’s type for the object doesn’t include that property.
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.
[vite] Internal server error: Failed to resolve import "x" from "src/App.jsx". Does the file exist?
Vite couldn’t find an imported file or package.
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.
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.
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
Node tried to run a TypeScript file as ESM without a TypeScript loader.
Two steps away (20)
npm ERR! code ERESOLVE — unable to resolve dependency tree
npm 7+ found conflicting peer dependency requirements and refuses to install a broken tree.
Error: ENOENT: no such file or directory
A file or directory the program tried to open doesn’t exist at that path.
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…).
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: x is not iterable
for…of, spread or destructuring was used on something that isn’t an array/iterable.
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.
java.lang.ClassCastException: class A cannot be cast to class B
An object was cast to a type it isn’t.
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.
System.InvalidCastException: Unable to cast object of type 'X' to type 'Y'
An explicit cast failed because the object’s runtime type isn’t the target type.
Swift: Cannot convert value of type 'X' to expected argument type 'Y'
The value’s type doesn’t match what the function or property expects.
Rust: error[E0308]: mismatched types — expected `X`, found `Y`
A value’s type doesn’t match what the context expects — common with &str vs String, Option/Result vs plain values, and integer ty…
TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor
With strictPropertyInitialization on, a class property declared without ? or a default isn’t set in the constructor.
Warning: A component is changing an uncontrolled input to be controlled
An input’s `value` started as `undefined` (uncontrolled) and later became a defined value (controlled), or vice versa.
Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?
A component returns two sibling JSX elements without a single parent.
Warning: Cannot update a component (`Parent`) while rendering a different component (`Child`)
A child component updated a parent’s state during its render instead of in an effect or event handler.
TS7006: Parameter 'x' implicitly has an 'any' type
A function parameter has no type annotation and TypeScript can’t infer one, which noImplicitAny (part of strict) forbids.
ReferenceError: x is not defined
Code refers to a variable or function name that doesn’t exist in the current scope.
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: 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"…
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.
Map another error
Popular: 4035004000xC000007BTypeErrorCritical error404NullPointerException