Converting circular structure to JSON — Any way to find what field it is complaining about?

Pardon me if this is too obvious. At the time of writing, I dont know what you have tried.

insert

console.log(the object); 

replacing ‘the object’ with the object you are passing to JSON.stringify()

insert this line before the JSON.stringify call

and look in the console log (shift control J) for the object. In the console log the object will be tagged with a “>” symbol which can be clicked to expand to the fields.

It is complaining about an object that has pointers into itself, like this kind of object:

A = [];
A[0] = A; 
JSON.stringify(A); // circular error

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)