RangeError: Maximum call stack size exceeded
A function called itself (directly or indirectly) too many times — usually infinite recursion.
Maximum call stack size exceededtoo much recursion Meaning
Each function call adds a frame to the call stack; when there are too many frames the engine throws. The cause is almost always recursion without a working base case, or two functions/setters/watchers calling each other.
Common causes
- Recursive function without a correct base case
- Setter/getter that sets/reads its own property
- Two functions or event handlers triggering each other
- JSON.stringify or deep clone on a circular structure (some libraries)
- React/Vue watchers updating the value they watch
⚡ Quick fix
- Look at the repeating frames in the stack trace
- Add/fix the base case of the recursion
- In setters, store into a different backing field (
this._value) - Convert deep recursion into an iterative loop
Detailed fix by platform
JavaScript
- Setter recursion:javascript
class User { set name(v) { this.name = v; } // ❌ calls the setter again forever set name(v) { this._name = v; } // ✅ get name() { return this._name; } }
How to diagnose
- Stack — Which functions repeat?
- Base case — Does recursion ever stop?
- Side effects — Do handlers trigger each other?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in JavaScript
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 8 Oct 2026