New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Converting circular structure to JSON #983
Comments
Greetings! The callback returns a }, (e, prediction) => {
if (e) {
return callback(e);
}
console.log(JSON.stringify(prediction)); <--------- This will crash
console.log('Prediction:', prediction);
callback(null, prediction);
}); Do this! }, (e, res) => {
if (e) {
return callback(e);
}
console.log(res.data); <--------- This will work :)
console.log('Prediction:', res.data);
callback(null, res.data);
}); Hope this helps! |
@JustinBeckwith Hi justin, im' using the promise interface instead of the callback. Do you happen to know how to handle that?
|
@uptownhr If you're seeing the exception when you call In your case, you might be able to work around with this or something similar:
It's apparently really hard for me to remember to do that, and error handling is ripe for missing code coverage, so I submitted the PR above. (Importantly, separately, the request headers in the AxiosErrors serialized by |
i resolve, this problem passed the value variable of return for variable e next return res.json(variable) |
Hei Devs,
In the newest version 25 there is a bug in the CloudML prediction response. The response has circular structure and can not be converted to JSON. Here my code:
I reverted back to ^24.0.0 and everything works fine.
Kindly Regards,
eduDorus
The text was updated successfully, but these errors were encountered: