E040Error
Maximum nesting depth exceeded
The JSON is nested more deeply than the parser allows.
What it means
To guard against stack-overflow attacks, the engine limits nesting depth (512 levels by default). Legitimate data rarely nests this deeply; hitting the limit often signals a cycle or malformed input.
Example
Invalid
[[[[[[ … 600 levels … ]]]]]]
Valid
(flatten or restructure the data)
How to fix it
Reduce the nesting depth, or raise the maxDepth option if the data is genuinely this deep.
Validate your JSON to see this and every other issue highlighted in one pass.
Diagnostics on this page come from @jsonlint/core, the open-source engine that powers the JSONLint validator. Install it with npm install @jsonlint/core.