Error map

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

Java · 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.

ClassCastException — java.lang.ClassCastException: class A cannot be cast to class B (Java)ClassCastEx…Implicit float to int — Deprecated: Implicit conversion from float 2.5 to int loses precision (PHP)Implicit float to i…Unable to cast object of type — System.InvalidCastException: Unable to cast object of type 'X' to type 'Y' (.NET)Unable to cast obje…Array to string conversion — Warning: Array to string conversion (PHP)Array to string con…Cannot convert value of type — Swift: Cannot convert value of type 'X' to expected argument type 'Y' (iOS)Cannot convert valu…TS2564 — TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor (TypeScript)TS2564Unsupported operand types — Fatal error: Uncaught TypeError: Unsupported operand types: string + int (PHP)Unsupported operand…TS2345 — TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. (Node.js)TS2345UnsupportedOperationException — java.lang.UnsupportedOperationException (List.of / Arrays.asList is immutable) (Java)UnsupportedOperatio…StringIndexOutOfBoundsException — java.lang.StringIndexOutOfBoundsException: begin 0, end 10, length 5 (Java)StringIndexOutOfBou…Cannot use object as array — Fatal error: Uncaught Error: Cannot use object of type stdClass as array (PHP)Cannot use object a…E0308 — Rust: error[E0308]: mismatched types — expected `X`, found `Y` (Rust)E0308Stream closed — java.io.IOException: Stream closed (Java)Stream closedDEP0005 — DeprecationWarning: Buffer() is deprecated due to security and usability issues (DEP0005) (Node.js)DEP0005TypeError — Fatal error: Uncaught TypeError: foo(): Argument #1 ($x) must be of type int, string given (PHP)TypeErrorDeprecated null to internal — Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated (PHP)Deprecated null to …AttributeError — AttributeError: 'X' object has no attribute 'y' (Python)AttributeErrorIllegalArgumentException — java.lang.IllegalArgumentException (Java)IllegalArgumentExce…IllegalStateException — java.lang.IllegalStateException (Java)IllegalStateExcepti…ERR_INVALID_ARG_TYPE — TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined (Node.js)ERR_INVALID_ARG_TYPEUndefined variable — Warning: Undefined variable $x (PHP)Undefined variableComposer memory — Composer: PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (PHP)Composer memoryTS7016 — 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)TS2304TS2339 — TS2339: Property 'x' does not exist on type 'Y'. (Node.js)TS2339not a constructor — TypeError: x is not a constructor (JavaScript)not a constructorTypeError operand — TypeError: unsupported operand type(s) for +: 'int' and 'str' (Python)TypeError operandTypeError concat — TypeError: can only concatenate str (not "int") to str (Python)TypeError concatDynamic property deprecated — Deprecated: Creation of dynamic property Foo::$bar is deprecated (PHP)Dynamic property de…Call to undefined function create_function() — WordPress on PHP 8: Fatal error: Uncaught Error: Call to undefined function create_function() / each() (WordPress)Call to undefined f…TS2322 — TS2322: Type 'X' is not assignable to type 'Y' (TypeScript)TS2322ERR_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)TS2307TS2532 / TS18048 — TS18048: 'x' is possibly 'undefined'. (TS2532: Object is possibly 'undefined'.) (Node.js)TS2532 / TS18048ConcurrentModificationException — java.util.ConcurrentModificationException (Java)ConcurrentModificat…ArrayIndexOutOfBoundsException — java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5 (Java)ArrayIndexOutOfBoun…ArithmeticException — java.lang.ArithmeticException: / by zero (Java)ArithmeticExceptionAccessDeniedException — java.nio.file.AccessDeniedException: /path (Java)AccessDeniedExcepti…invalid string length — RangeError: Invalid string length (JavaScript)invalid string leng…IndexError — IndexError: list index out of range (Python)IndexErrorAllowed memory size exhausted — PHP Fatal error: Allowed memory size of X bytes exhausted (PHP)Allowed memory size…Call to undefined function — PHP Fatal error: Uncaught Error: Call to undefined function (PHP)Call to undefined f…Cannot redeclare — Fatal error: Cannot redeclare function foo() (previously declared in …) (PHP)Cannot redeclareTypeError not callable — TypeError: 'str' object is not callable (Python)TypeError not calla…unhashable type — TypeError: unhashable type: 'list' (Python)unhashable typeCS0246 — error CS0246: The type or namespace name 'X' could not be found (are you missing a using directive or an assembly reference?) (.NET)CS0246ClassNotFoundException — java.lang.ClassNotFoundException / NoClassDefFoundError (Java)ClassNotFoundExcept…EPIPE — Error: write EPIPE (Node.js)EPIPEERR_STREAM_PREMATURE_CLOSE — Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close (Node.js)ERR_STREAM_PREMATUR…

Directly related (12)

Implicit float to intPHP

Deprecated: Implicit conversion from float 2.5 to int loses precision

PHP 8.1+ warns when a float with a fractional part is silently converted to int (array keys, % operator, int parameters).

Unable to cast object of type.NET

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.

Array to string conversionPHP

Warning: Array to string conversion

An array was used where a string is expected — echoing it, concatenating it, or passing it to a string function.

Cannot convert value of typeiOS

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.

TS2564TypeScript

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.

Unsupported operand typesPHP

Fatal error: Uncaught TypeError: Unsupported operand types: string + int

An arithmetic or array operator was used with incompatible types (PHP 8 is stricter than PHP 7).

TS2345Node.js

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.

UnsupportedOperationExceptionJava

java.lang.UnsupportedOperationException (List.of / Arrays.asList is immutable)

Code tried to modify an immutable or fixed-size collection.

StringIndexOutOfBoundsExceptionJava

java.lang.StringIndexOutOfBoundsException: begin 0, end 10, length 5

substring()/charAt() used an index outside the string.

Cannot use object as arrayPHP

Fatal error: Uncaught Error: Cannot use object of type stdClass as array

Code used array syntax (`$x['key']`) on an object.

E0308Rust

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…

Stream closedJava

java.io.IOException: Stream closed

Code read or wrote a stream after it was closed — often by a try-with-resources block or a wrapper closing the underlying stream.

Two steps away (36)

DEP0005Node.js

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

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

TypeErrorPHP

Fatal error: Uncaught TypeError: foo(): Argument #1 ($x) must be of type int, string given

A function received a value of the wrong type for a typed parameter.

Deprecated null to internalPHP

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated

PHP 8.1+ warns when null is passed to a built-in function that expects a string/int.

AttributeErrorPython

AttributeError: 'X' object has no attribute 'y'

You accessed an attribute or method that doesn’t exist on that object type.

IllegalArgumentExceptionJava

java.lang.IllegalArgumentException

A method rejected an argument value as invalid.

IllegalStateExceptionJava

java.lang.IllegalStateException

A method was called when the object wasn’t in the right state for it.

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.

Undefined variablePHP

Warning: Undefined variable $x

PHP read a variable that was never assigned in the current scope.

Composer memoryPHP

Composer: PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted

Composer ran out of memory while resolving or installing dependencies.

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.

TS2339Node.js

TS2339: Property 'x' does not exist on type 'Y'.

TypeScript’s type for the object doesn’t include that property.

not a constructorJavaScript

TypeError: x is not a constructor

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

TypeError operandPython

TypeError: unsupported operand type(s) for +: 'int' and 'str'

An operator was used between two incompatible types, such as adding a number to a string.

TypeError concatPython

TypeError: can only concatenate str (not "int") to str

You joined a string and a non-string with +.

Dynamic property deprecatedPHP

Deprecated: Creation of dynamic property Foo::$bar is deprecated

PHP 8.2+ deprecates creating properties that aren’t declared in the class.

Call to undefined function create_function()WordPress

WordPress on PHP 8: Fatal error: Uncaught Error: Call to undefined function create_function() / each()

An old plugin/theme uses functions removed in PHP 8 (create_function, each), so the site breaks after a PHP upgrade.

TS2322TypeScript

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.

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.

TS2532 / TS18048Node.js

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.

ConcurrentModificationExceptionJava

java.util.ConcurrentModificationException

A collection was modified while being iterated (even in a single thread).

ArrayIndexOutOfBoundsExceptionJava

java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5

Code accessed an array index outside 0 … length-1.

ArithmeticExceptionJava

java.lang.ArithmeticException: / by zero

Integer division or modulo by zero.

AccessDeniedExceptionJava

java.nio.file.AccessDeniedException: /path

The OS denied a file operation to the Java process.

invalid string lengthJavaScript

RangeError: Invalid string length

A string grew beyond the engine’s maximum length — usually runaway concatenation or huge JSON.stringify output.

IndexErrorPython

IndexError: list index out of range

Code accessed a list position that doesn’t exist.

Allowed memory size exhaustedPHP

PHP Fatal error: Allowed memory size of X bytes exhausted

The script tried to use more memory than PHP’s `memory_limit` allows.

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.

Cannot redeclarePHP

Fatal error: Cannot redeclare function foo() (previously declared in …)

The same function (or class) was defined twice — usually a file included more than once.

TypeError not callablePython

TypeError: 'str' object is not callable

You used parentheses on something that isn’t a function — often a variable shadowing a built-in.

unhashable typePython

TypeError: unhashable type: 'list'

A mutable object (list, dict, set) was used as a dict key or set member.

CS0246.NET

error CS0246: The type or namespace name 'X' could not be found (are you missing a using directive or an assembly reference?)

The compiler doesn’t know the type — missing using, missing NuGet package/project reference, or a target framework mismatch.

ClassNotFoundExceptionJava

java.lang.ClassNotFoundException / NoClassDefFoundError

The JVM couldn’t find a class on the classpath at runtime.

EPIPENode.js

Error: write EPIPE

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

ERR_STREAM_PREMATURE_CLOSENode.js

Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close

A stream ended or was destroyed before it finished — often a client disconnect or upstream aborting a download.