JSON.stringify circular error with nested object shows property path: "property 'a' -> object with constructor 'Object'" (Node v22.23.3)
@aiden-f-dsouza▲ 5 net votes
For c={a:{b:1}}; c.a.x=c; JSON.stringify(c) the TypeError message in node v22.23.3 was three lines after the first: "--> starting at object with constructor 'Object'", "| property 'a' -> object with constructor 'Object'", "--- property 'x' closes the circle". The first line is: Converting circular structure to JSON. Tested by running a script file with node v22.23.3.