Error map

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

Node.js · layer 4, Application & API

Open the full error page →

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

ERR_HTTP_HEADERS_SENT — Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client (Node.js)ERR_HTTP_HE…MODULE_NOT_FOUND — Error: Cannot find module 'x' (MODULE_NOT_FOUND) (Node.js)MODULE_NOT_FOUNDDEP0005 — DeprecationWarning: Buffer() is deprecated due to security and usability issues (DEP0005) (Node.js)DEP0005SyntaxError import — SyntaxError: Cannot use import statement outside a module (Node.js)SyntaxError importpath-to-regexp — TypeError: Missing parameter name at 1 (path-to-regexp) (Node.js)path-to-regexpHeaders already sent — Warning: Cannot modify header information - headers already sent (PHP)Headers already sentreq.body undefined — Express: req.body is undefined / {} (body parser missing) (Node.js)req.body undefinedRouter.use middleware — TypeError: Router.use() requires a middleware function but got a Object (Node.js)Router.use middlewa…secure cookie — Error: Cannot send secure cookie over unencrypted connection (Authentication)secure cookieNo authorization token was found — UnauthorizedError: No authorization token was found (express-jwt) (Authentication)No authorization to…secret option required — Error: secret option required for sessions (express-session) (Authentication)secret option requi…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…ERR_IMPORT_ATTRIBUTE_MISSING — TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module needs an import attribute of "type: json" (Node.js)ERR_IMPORT_ATTRIBUT…Unhandled 'error' event — Error: Unhandled 'error' event (events.js / node:events) (Node.js)Unhandled 'error' e…EBADENGINE — npm WARN EBADENGINE Unsupported engine / The engine "node" is incompatible with this module (Node.js)EBADENGINEReferenceError — ReferenceError: x is not defined (JavaScript)ReferenceErrorERR_REQUIRE_ESM — Error [ERR_REQUIRE_ESM]: require() of ES Module not supported (Node.js)ERR_REQUIRE_ESMERR_UNKNOWN_FILE_EXTENSION — TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" (Node.js)ERR_UNKNOWN_FILE_EX…404 — HTTP 404 Not Found (HTTP)404405 — HTTP 405 Method Not Allowed (HTTP)405Whitelabel Error Page — Whitelabel Error Page — This application has no explicit mapping for /error (Java)Whitelabel Error Pa…500 — HTTP 500 Internal Server Error (HTTP)500Call to undefined function — PHP Fatal error: Uncaught Error: Call to undefined function (PHP)Call to undefined f…Undefined array key — Warning: Undefined array key / Undefined index (PHP)Undefined array keyDEP0040 — DeprecationWarning: The `punycode` module is deprecated (DEP0040) (Node.js)DEP0040Mongoose ValidationError — ValidationError: User validation failed: email: Path `email` is required. (Node.js)Mongoose Validation…400 — 400 Bad Request: multipart boundary not found (HTTP)400not a constructor — TypeError: x is not a constructor (JavaScript)not a constructorTDZ — ReferenceError: Cannot access 'x' before initialization (JavaScript)TDZ1046 — MySQL ERROR 1046 (3D000): No database selected (MySQL)1046SameSite cookie blocked — This Set-Cookie was blocked because it had the "SameSite=Lax" attribute but came from a cross-site response / SameSite=None requires Secure (Authentication)SameSite cookie blo…Missing credentials — Passport local: Missing credentials (400) (Authentication)Missing credentialsTokenExpiredError — JWT Expired / Invalid Token (Authentication)TokenExpiredErrorMissing Authentication Token — {"message":"Missing Authentication Token"} / No authorization token was found (Authentication)Missing Authenticat…invalid_token — invalid_token: The access token is invalid (JsonWebTokenError: invalid signature / jwt malformed) (Authentication)invalid_tokenFailed to serialize user into session — Passport.js: Error: Failed to serialize user into session (Authentication)Failed to serialize…440 — HTTP 440 Login Time-out (IIS) (HTTP)440authorization_request_not_found — [authorization_request_not_found] Spring OAuth2 login callback (Authentication)authorization_reque…

Directly related (10)

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.

DEP0005Node.js

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

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

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

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?'.

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.

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.

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.

secure cookieAuthentication

Error: Cannot send secure cookie over unencrypted connection

express-session was told to set a `Secure` cookie but the request looks like plain HTTP to Express, usually behind a proxy.

No authorization token was foundAuthentication

UnauthorizedError: No authorization token was found (express-jwt)

express-jwt middleware ran on a route and found no token in the Authorization header.

secret option requiredAuthentication

Error: secret option required for sessions (express-session)

express-session needs a `secret` to sign the session cookie and none was provided.

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

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.

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.

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.

ReferenceErrorJavaScript

ReferenceError: x is not defined

Code refers to a variable or function name that doesn’t exist in the current 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…).

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.

404HTTP

HTTP 404 Not Found

The server can’t find anything at the requested URL.

405HTTP

HTTP 405 Method Not Allowed

The URL exists, but it doesn’t accept the HTTP method you used (e.g. POST to a GET-only route).

Whitelabel Error PageJava

Whitelabel Error Page — This application has no explicit mapping for /error

Spring Boot’s default error page — the request hit no controller mapping (404) or a controller threw (500).

500HTTP

HTTP 500 Internal Server Error

The server hit an unexpected condition — usually an unhandled exception or misconfiguration in the application.

Call to undefined functionPHP

PHP Fatal error: Uncaught Error: Call to undefined function

PHP can’t find the function you called — usually a missing extension, missing include, or namespace issue.

Undefined array keyPHP

Warning: Undefined array key / Undefined index

Your code reads an array key that doesn’t exist — common with `$_GET`, `$_POST` and decoded JSON.

DEP0040Node.js

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

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

Mongoose ValidationErrorNode.js

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

A document failed Mongoose schema validation before saving.

400HTTP

400 Bad Request: multipart boundary not found

A multipart/form-data request arrived without a valid boundary, so the server can't split the parts.

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.

1046MySQL

MySQL ERROR 1046 (3D000): No database selected

A query referenced tables without a database selected (no USE and no db in the connection).

SameSite cookie blockedAuthentication

This Set-Cookie was blocked because it had the "SameSite=Lax" attribute but came from a cross-site response / SameSite=None requires Secure

The browser refused to store or send an auth/session cookie because of SameSite or Secure rules — so logins don’t “stick” across…

Missing credentialsAuthentication

Passport local: Missing credentials (400)

The local strategy did not find `username` and `password` fields in the request body.

TokenExpiredErrorAuthentication

JWT Expired / Invalid Token

The JSON Web Token sent with the request is expired, malformed or signed with a different key, so the API rejects it (usually wit…

Missing Authentication TokenAuthentication

{"message":"Missing Authentication Token"} / No authorization token was found

The request reached a protected endpoint without credentials — or, on AWS API Gateway, it hit a path/method that doesn’t exist.

invalid_tokenAuthentication

invalid_token: The access token is invalid (JsonWebTokenError: invalid signature / jwt malformed)

A token was sent but the server couldn’t verify it — bad signature, malformed, revoked, or issued for another audience or environ…

Failed to serialize user into sessionAuthentication

Passport.js: Error: Failed to serialize user into session

Passport logged a user in but there’s no serializeUser function (or it didn’t call done), so the session can’t store the user.

440HTTP

HTTP 440 Login Time-out (IIS)

Microsoft IIS reports that the client's session has expired and a new login is needed.

authorization_request_not_foundAuthentication

[authorization_request_not_found] Spring OAuth2 login callback

Spring could not find the saved authorisation request when the provider redirected back, so the login cannot be completed.