Cause 1 of 6
Recursion with no base case, or one that is never reached.
Check that the terminating condition actually fires — log the depth and the argument on entry. A counter decremented past its stopping value, so the check never matches exactly, is the classic version of this.
Cause 2 of 6
A getter or setter that refers to itself.
set value(v) { this.value = v } calls itself forever. Store behind a different name — a backing field such as this._value, or a private #value — so the accessor and the storage are distinct.
Cause 3 of 6
In React, calling a state setter during render.
Setting state in the component body triggers a re-render, which sets it again. Move the call into an event handler, or into an effect with a dependency list that stops it looping.
Cause 4 of 6
Walking a data structure that contains a cycle.
A depth-first traversal of a graph with a back-reference never terminates. Track visited nodes in a Set and skip them. (Note that JSON.stringify on a cycle throws a different error — 'Converting circular structure to JSON'.)
Cause 5 of 6
Spreading an enormous array into a function call.
Math.max(...values) with hundreds of thousands of elements exceeds the argument limit rather than recursing. Use a reduce, or process the array in chunks.
Cause 6 of 6
Two functions calling each other indirectly.
The stack trace shows the repeating cycle — read the frames that repeat, not just the top one. Event handlers that dispatch the event they handle are a common form.