TypeErrorTypeError
A value is not of the expected type. This is the most common JavaScript error, occurring when an operation encounters a value of the wrong type.
Blader door alle 100 JavaScript-fouten-foutcodes met oorzaken, oplossingen en voorbeelden.
TypeErrorA value is not of the expected type. This is the most common JavaScript error, occurring when an operation encounters a value of the wrong type.
TypeError: x is not a functionAn attempt was made to call a value as a function when it is not a function.
TypeError: Cannot read properties of undefined/nullAn attempt was made to access a property or method on undefined or null.
TypeError: Cannot set properties of undefined/nullAn attempt was made to set a property on undefined or null.
TypeError: x is not iterableA value that is not iterable was used where an iterable was expected, such as in a for...of loop or spread operator.
TypeError: x is not a constructorAn attempt was made to use the new keyword with a value that is not a constructor.
TypeError: Assignment to constant variableAn attempt was made to reassign a variable declared with const.
TypeError: Cannot convert undefined or null to objectA built-in method that expects an object received null or undefined instead.
TypeError: Reduce of empty array with no initial valueArray.reduce() was called on an empty array without providing an initial value.
TypeError: Cannot assign to read only propertyAn attempt was made to write to a property that is read-only, either because the object is frozen or the property is defined as non-writable.
ReferenceErrorA reference was made to a variable that does not exist in the current scope.
ReferenceError: x is not definedA variable was referenced that has not been declared in any accessible scope.
ReferenceError: Cannot access before initializationA variable declared with let or const was accessed before its declaration in the temporal dead zone.
ReferenceError: Invalid left-hand side in assignmentAn assignment was attempted to something that cannot be assigned to.
SyntaxErrorThe JavaScript engine encountered code that does not conform to the language syntax.
SyntaxError: Unexpected tokenThe parser encountered a token (character or keyword) that was not expected at that position in the code.
SyntaxError: Unexpected end of inputThe parser reached the end of the input while still expecting more code, usually due to unclosed brackets or strings.
SyntaxError: JSON.parse unexpected characterJSON.parse() encountered invalid JSON syntax, such as single quotes, trailing commas, or unquoted keys.
SyntaxError: Missing ) after argument listA function call is missing its closing parenthesis.
SyntaxError: Unterminated string literalA string literal is missing its closing quote.
SyntaxError: Illegal return statementA return statement was used outside of a function body.
SyntaxError: Identifier has already been declaredA variable with the same name was declared twice in the same scope using let or const.
SyntaxError: Cannot use import statement outside a moduleES module import syntax was used in a file that is not treated as a module.
SyntaxError: await is only valid in async functionsThe await keyword was used outside of an async function.
RangeErrorA value is not within the expected range, such as an invalid array length or exceeding the call stack size.
RangeError: Maximum call stack size exceededThe JavaScript call stack has been exhausted, usually due to infinite or excessively deep recursion.
RangeError: Invalid array lengthAn array was created with an invalid length, such as a negative number or a non-integer.
RangeError: Invalid dateAn invalid date string was passed to a Date method that requires a valid date.
RangeError: precision is out of rangeA precision value passed to toFixed(), toPrecision(), or toExponential() is outside the allowed range.
URIErrorA global URI handling function (decodeURIComponent, encodeURI) received a malformed URI.
EvalErrorAn error related to the global eval() function. This error is rarely encountered in modern JavaScript.
InternalError: too much recursionFirefox-specific error equivalent to RangeError: Maximum call stack size exceeded in Chrome/Node.js.
AggregateErrorAn error that wraps multiple errors, typically thrown when all promises in Promise.any() are rejected.
UnhandledPromiseRejectionA Promise was rejected but no .catch() handler or try-catch block was present to handle the rejection.
DOMException: The operation was abortedAn operation was canceled via an AbortController signal.
DOMException: NetworkErrorA network operation failed, typically during a fetch request when the network is unreachable.
DOMException: QuotaExceededErrorA storage operation exceeded the available quota for localStorage, IndexedDB, or other browser storage.
DOMException: SecurityErrorA security-sensitive operation was blocked by the browser's security policies.
DOMException: NotAllowedErrorA browser API call was blocked because it requires user interaction or permission that was not granted.
CORS Error: No Access-Control-Allow-OriginThe browser blocked a cross-origin request because the server did not include the required CORS headers.
CORS Error: Preflight request failedThe browser's CORS preflight OPTIONS request was rejected or returned invalid CORS headers.
ECONNREFUSEDThe connection was refused because no server is listening on the target address and port.
ECONNRESETThe remote server forcibly closed the connection.
EADDRINUSEThe address (port) is already in use by another process.
ENOTFOUNDDNS lookup failed; the hostname could not be resolved to an IP address.
ETIMEDOUTA connection or operation timed out because the remote host did not respond in time.
ENOENTThe specified file or directory does not exist at the given path.
EACCESThe process does not have permission to access the file or resource.
EPERMThe operation is not permitted, even with appropriate permissions, due to OS-level restrictions.
EMFILEThe process has reached the maximum number of open file descriptors allowed.
ENFILEThe system-wide limit on the total number of open files has been reached.
EISDIRA file operation was attempted on a path that is a directory.
ENOTDIRA directory operation was attempted on a path that is not a directory.
EEXISTA file creation operation failed because the target path already exists.
EPIPEAn attempt was made to write to a pipe or socket whose reading end has been closed.
ENOSPCThe disk is full or the inode table is exhausted.
ERR_HTTP_HEADERS_SENTAn attempt was made to set headers or send a response after the HTTP response was already sent.
ERR_MODULE_NOT_FOUNDAn ES module import could not be resolved because the specified file does not exist.
ERR_REQUIRE_ESMA require() call was used to load an ES module, which is not allowed.
ERR_INVALID_ARG_TYPEA Node.js API received an argument of the wrong type.
ERR_INVALID_URLAn invalid URL was passed to the URL constructor or a Node.js API.
ERR_SOCKET_BAD_PORTAn invalid port number was specified for a network operation.
ERR_TLS_CERT_ALTNAME_INVALIDThe hostname does not match any of the Subject Alternative Names (SANs) in the server's TLS certificate.
ERR_BUFFER_OUT_OF_BOUNDSAn attempt was made to read or write outside the bounds of a Buffer.
ERR_STREAM_PREMATURE_CLOSEA stream was closed before it finished reading or writing all data.
ERR_WORKER_OUT_OF_MEMORYA Worker thread ran out of memory.
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memoryThe V8 engine ran out of heap memory, causing the Node.js process to crash.
ERR_MISSING_ARGSA required argument was not passed to a Node.js API function.
ERR_UNESCAPED_CHARACTERSA string containing unescaped characters was passed where an escaped string was expected.
ERR_UNKNOWN_ENCODINGAn unknown or unsupported encoding was passed to a Node.js API.
ERR_CRYPTO_INVALID_STATEA crypto operation was performed in an invalid state.
ERR_DLOPEN_FAILEDA native addon (C++ .node file) failed to load.
ERR_OSSL_EVP_UNSUPPORTEDAn OpenSSL operation is unsupported, typically because Node.js 17+ uses OpenSSL 3.0 which disables legacy algorithms.
ERR_SERVER_ALREADY_LISTENThe server.listen() method was called when the server is already listening.
ERR_FS_CP_DIR_TO_NON_DIRAn attempt was made to copy a directory to a non-directory destination.
Error: Cannot find moduleNode.js could not locate the specified module in any of the searched paths.
ECONNABORTEDA connection was aborted, typically due to a timeout on the client side.
EHOSTUNREACHThe target host is unreachable, typically due to network routing issues.
ENETUNREACHThe network is unreachable; no route to the target network could be found.
ERR_ASSERTIONAn assertion from the Node.js assert module failed.
TypeError: Converting circular structure to JSONJSON.stringify() encountered an object with circular references that cannot be serialized to JSON.
TypeError: Method called on incompatible receiverA method was called with a 'this' value that is not the expected type.
TypeError: Cannot delete property of objectAn attempt was made to delete a non-configurable property of an object in strict mode.
TypeError: Cannot convert a Symbol value to a stringAn implicit conversion of a Symbol to a string was attempted, which is not allowed.
TypeError: Cannot add property, object is not extensibleAn attempt was made to add a property to an object that has been made non-extensible.
SyntaxError: Applying delete to unqualified name in strict modeThe delete operator was used on a plain variable name in strict mode, which is not allowed.
SyntaxError: Missing initializer in const declarationA const variable was declared without an initial value.
SyntaxError: JSON.parse: bad parsingFirefox-specific error message for invalid JSON passed to JSON.parse().
ERR_STREAM_WRITE_AFTER_ENDAn attempt was made to write to a stream after it has been ended.
ERR_HTTP2_STREAM_ERRORAn error occurred on an HTTP/2 stream.
ERR_CHILD_PROCESS_STDIO_MAXBUFFERA child process produced more output than the maxBuffer limit allows.
ERR_INVALID_RETURN_VALUEA function returned a value of an unexpected type.
ERR_UNHANDLED_REJECTIONNode.js is configured to throw on unhandled promise rejections and one was detected.
ERR_ASYNC_CALLBACKA non-function value was passed where an async callback was expected.
ERR_PACKAGE_PATH_NOT_EXPORTEDA subpath of a package was imported that is not defined in the package's exports field.
ERR_IMPORT_ASSERTION_TYPE_FAILEDAn import assertion specified a type that does not match the actual module type.
ERR_NETWORK_IMPORT_DISALLOWEDA network import (HTTP/HTTPS) was attempted but is not allowed by the current Node.js configuration.
ERR_INSPECTOR_ALREADY_ACTIVATEDThe Node.js inspector (debugger) was activated more than once.
DOMException: InvalidStateErrorAn operation was attempted on an object that is in an invalid state for that operation.
DOMException: DataCloneErrorAn object could not be cloned using the structured clone algorithm.