Error map

SyntaxError import SyntaxError: Cannot use import statement outside a module

Node.js · layer 4, Application & API

Open the full error page →

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

SyntaxError import — SyntaxError: Cannot use import statement outside a module (Node.js)SyntaxError…MODULE_NOT_FOUND — Error: Cannot find module 'x' (MODULE_NOT_FOUND) (Node.js)MODULE_NOT_FOUNDReferenceError — ReferenceError: x is not defined (JavaScript)ReferenceErrorJest ESM — Jest: SyntaxError: Cannot use import statement outside a module (Jest encountered an unexpected token) (React)Jest ESMERR_REQUIRE_ESM — Error [ERR_REQUIRE_ESM]: require() of ES Module not supported (Node.js)ERR_REQUIRE_ESMERR_PACKAGE_PATH_NOT_EXPORTED — Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './x' is not defined by "exports" (Node.js)ERR_PACKAGE_PATH_NO…Unhandled 'error' event — Error: Unhandled 'error' event (events.js / node:events) (Node.js)Unhandled 'error' e…WRONGTYPE — WRONGTYPE Operation against a key holding the wrong kind of value (Node.js)WRONGTYPEERR_HTTP_HEADERS_SENT — Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client (Node.js)ERR_HTTP_HEADERS_SE…req.body undefined — Express: req.body is undefined / {} (body parser missing) (Node.js)req.body undefinedERR_IMPORT_ATTRIBUTE_MISSING — TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module needs an import attribute of "type: json" (Node.js)ERR_IMPORT_ATTRIBUT…maxBuffer exceeded — RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded (Node.js)maxBuffer exceededERR_UNKNOWN_FILE_EXTENSION — TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" (Node.js)ERR_UNKNOWN_FILE_EX…ERESOLVE — npm ERR! code ERESOLVE — unable to resolve dependency tree (npm)ERESOLVEENOENT — Error: ENOENT: no such file or directory (Node.js)ENOENTTypeError: not a function — TypeError: x is not a function (JavaScript)TypeError: not a fu…TypeError — TypeError: Cannot read properties of undefined (reading 'x') (JavaScript)TypeErrorNameError — NameError: name 'x' is not defined (Python)NameErrorHydration failed — Error: Hydration failed because the initial UI does not match what was rendered on the server (React)Hydration failednot wrapped in act — Warning: An update to Component inside a test was not wrapped in act(...) (React)not wrapped in actUnable to find an element — TestingLibraryElementError: Unable to find an element with the text: x (React)Unable to find an e…Expected to be running in 'ProxyZone' — Angular tests: Error: Expected to be running in 'ProxyZone', but it was not found. (Angular)Expected to be runn…UnhandledPromiseRejection — Node.js: [UnhandledPromiseRejection] — This error originated either by throwing inside of an async function without a catch block (Node.js)UnhandledPromiseRej…EBADENGINE — npm WARN EBADENGINE Unsupported engine / The engine "node" is incompatible with this module (Node.js)EBADENGINEDEP0040 — DeprecationWarning: The `punycode` module is deprecated (DEP0040) (Node.js)DEP0040node-sass — Error: Node Sass does not yet support your current environment (Node.js)node-sassEADDRINUSE — Error: listen EADDRINUSE: address already in use :::3000 (Node.js)EADDRINUSElisten EACCES — Error: listen EACCES: permission denied 0.0.0.0:80 (Node.js)listen EACCESMaxListenersExceededWarning — MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 listeners added (Node.js)MaxListenersExceede…DEP0005 — DeprecationWarning: Buffer() is deprecated due to security and usability issues (DEP0005) (Node.js)DEP0005NOAUTH — ReplyError: NOAUTH Authentication required. (Node.js)NOAUTHError establishing a Redis connection — WordPress: Error establishing a Redis connection (object cache) (WordPress)Error establishing …Headers already sent — Warning: Cannot modify header information - headers already sent (PHP)Headers already sentRouter.use middleware — TypeError: Router.use() requires a middleware function but got a Object (Node.js)Router.use middlewa…path-to-regexp — TypeError: Missing parameter name at 1 (path-to-regexp) (Node.js)path-to-regexpMongoose ValidationError — ValidationError: User validation failed: email: Path `email` is required. (Node.js)Mongoose Validation…EPIPE — Error: write EPIPE (Node.js)EPIPEspawn EACCES — Error: spawn EACCES (Node.js)spawn EACCESOSError Errno 98 — OSError: [Errno 98] Address already in use (Python)OSError Errno 98TS2307 — 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)TS7016TS2304 — TS2304: Cannot find name 'x'. (Node.js)TS2304

Directly related (12)

MODULE_NOT_FOUNDNode.js

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.

ReferenceErrorJavaScript

ReferenceError: x is not defined

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

Jest ESMReact

Jest: SyntaxError: Cannot use import statement outside a module (Jest encountered an unexpected token)

Jest tried to run untransformed ES module syntax — usually from a dependency in node_modules.

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

ERR_PACKAGE_PATH_NOT_EXPORTEDNode.js

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './x' is not defined by "exports"

You imported a deep path inside a package that its package.json "exports" field doesn’t expose.

Unhandled 'error' eventNode.js

Error: Unhandled 'error' event (events.js / node:events)

An EventEmitter (stream, socket, child process, server) emitted 'error' and nothing listened for it, so Node crashed.

WRONGTYPENode.js

WRONGTYPE Operation against a key holding the wrong kind of value

A Redis command was used on a key of a different type (e.g. HGET on a string key).

ERR_HTTP_HEADERS_SENTNode.js

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

An Express/Node handler tried to send a second response (or set headers) after one was already sent.

req.body undefinedNode.js

Express: req.body is undefined / {} (body parser missing)

Express didn’t parse the request body because no body-parsing middleware matched the request’s Content-Type.

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.

maxBuffer exceededNode.js

RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded

child_process.exec/execSync produced more output than its buffer allows (default 1 MB).

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.

Two steps away (29)

ERESOLVEnpm

npm ERR! code ERESOLVE — unable to resolve dependency tree

npm 7+ found conflicting peer dependency requirements and refuses to install a broken tree.

ENOENTNode.js

Error: ENOENT: no such file or directory

A file or directory the program tried to open doesn’t exist at that path.

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

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…

NameErrorPython

NameError: name 'x' is not defined

Python doesn’t know the name — it was never assigned/imported in this scope, or it’s misspelled.

Hydration failedReact

Error: Hydration failed because the initial UI does not match what was rendered on the server

The HTML rendered on the server differs from the first client render, so React (Next.js/Remix) can’t attach to it.

not wrapped in actReact

Warning: An update to Component inside a test was not wrapped in act(...)

A component updated state after the test’s synchronous assertions — async work wasn’t awaited.

Unable to find an elementReact

TestingLibraryElementError: Unable to find an element with the text: x

getBy* found no matching element in the rendered output.

Expected to be running in 'ProxyZone'Angular

Angular tests: Error: Expected to be running in 'ProxyZone', but it was not found.

`fakeAsync` / `waitForAsync` was used, but the test environment's zone testing setup is missing.

UnhandledPromiseRejectionNode.js

Node.js: [UnhandledPromiseRejection] — This error originated either by throwing inside of an async function without a catch block

A promise rejected and nothing handled it; since Node 15 this crashes the process.

EBADENGINENode.js

npm WARN EBADENGINE Unsupported engine / The engine "node" is incompatible with this module

A package requires a different Node.js version than the one you’re running.

DEP0040Node.js

DeprecationWarning: The `punycode` module is deprecated (DEP0040)

A dependency imports Node’s built-in punycode module, deprecated since Node 21.

node-sassNode.js

Error: Node Sass does not yet support your current environment

node-sass (deprecated) has no binary for your Node version/OS.

EADDRINUSENode.js

Error: listen EADDRINUSE: address already in use :::3000

Another process is already listening on that port.

listen EACCESNode.js

Error: listen EACCES: permission denied 0.0.0.0:80

Node isn’t allowed to bind that port — ports below 1024 need root on Linux/macOS, and some Windows ports are reserved.

MaxListenersExceededWarningNode.js

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 listeners added

More than 10 listeners were added to one event — often a leak where listeners are added repeatedly.

DEP0005Node.js

DeprecationWarning: Buffer() is deprecated due to security and usability issues (DEP0005)

Code (yours or a dependency) uses the deprecated new Buffer() constructor.

NOAUTHNode.js

ReplyError: NOAUTH Authentication required.

The Redis server requires a password (or ACL user) but the client didn’t authenticate.

Error establishing a Redis connectionWordPress

WordPress: Error establishing a Redis connection (object cache)

The persistent object cache drop-in (object-cache.php) can’t connect to Redis, so the whole site fails.

Headers already sentPHP

Warning: Cannot modify header information - headers already sent

You called `header()`, `setcookie()` or `session_start()` after output had already been sent to the browser.

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.

path-to-regexpNode.js

TypeError: Missing parameter name at 1 (path-to-regexp)

An Express 5 (path-to-regexp v8) route uses old wildcard syntax like '*' or '/:id?'.

Mongoose ValidationErrorNode.js

ValidationError: User validation failed: email: Path `email` is required.

A document failed Mongoose schema validation before saving.

EPIPENode.js

Error: write EPIPE

Node wrote to a pipe or socket whose other end was already closed.

spawn EACCESNode.js

Error: spawn EACCES

Node tried to execute a file that isn’t executable (missing +x permission) or isn’t a program.

OSError Errno 98Python

OSError: [Errno 98] Address already in use

The port your server wants to bind is already taken by another process.

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.

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.