Passing an object to JSON.stringify
throws the error "Converting circular structure to JSON" but I'm not exactly sure why.
I'm passing the object via server-side node.js
app.get('/', function(req,res){
res.render('index.jade', {object: object});
});
to Jade
script var table = !{JSON.stringify(object)};
And it's throwing the error when Jade tries to parse the object
.
But I have no reason to believe object
have circular references. Infact I do a
console.info(JSON.stringify(req.user.table.export))
right before res.render
and it works fine!
Is there a way to know precisely where did the circular reference come into being?
edit found something, but unfortunately can't use it in Jade.
edit2 actually can