Game dev
Saved & recent

Stack trace

Also called: stack traceback, backtrace

Related terms: call stack, exception, debugger

A list of the active function calls at a particular moment, often captured when an error occurs. It shows how execution reached the failing code, with file names and line numbers when that information is available.

If takeDamage fails, its caller might be onCollision, called from update. Read the trace to find the relevant call in your code. It describes the active chain, not a complete history of everything the game did.

Further reading
GNU Project: Backtrace
TypeError state is undefined takeDamage Health.ts:28 onCollision Physics.ts:64 update Game.ts:17 Health.ts 27 function takeDamage(amount) { 28 state.current -= amount; 29 state.flash = true; 30 } failing line active call chain selected source
Read the active chain back from takeDamage to onCollision and update. The top frame points to the line accessing the missing state.

View in the full Game dev collection