check if you have not added async and await
full problem can be like this:
Converting circular structure to JSON
--> starting at object with constructor 'MongoClient'
| property 's' -> object with constructor 'Object'
| property 'sessionPool' -> object with constructor 'ServerSessionPool'
--- property 'client' closes the circle
//The error means that the object you pass in the request has a circular reference, something like:
var a = {};
a.b = a;
var win = window.open('http://www.google.com', 'google','width=800,height=600,status=0,toolbar=0');
var timer = setInterval(function() {
if(win.closed) {
clearInterval(timer);
alert('closed');
}
}, 1000);
I run into this issue, because i was sending as response the full response of another api call instead of just the data i needed.