TypeError: Converting circular structure to JSON at Object.stringify (native)
See original GitHub issue- Node Version:v6.9.1
- Npm Version:3.10.8
- Platform: MacOSX
- Package Version: 5.0.2
I’m trying to serve content as a proxy in express,
`async getIndex(req: Request, res: Response, next: NextFunction) {
const news = await this.cf.getNews();
res.send(news);
}`
However it is throwing this TypeError: Converting circular structure to JSON at Object.stringify (native).
Do you know anyway around this so I can serve the content via res.json(), res.send() etc?
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
TypeError: Converting circular structure to JSON in nodejs
TypeError : Converting circular structure to JSON in nodejs: This error can be seen on Arangodb when using it ...
Read more >What is TypeError: Converting circular structure to JSON?
TypeError : Converting circular structure to JSON occurs when you try to reference your variable name within the JSON object.
Read more >TypeError: Converting circular structure to JSON in JS
The "Converting circular structure to JSON" error occurs when we pass an object that contains circular references to the JSON.stringify() method.
Read more >Converting Circular Structure to JSON - Career Karma
Circular JSON serializes and deserializes otherwise valid JSON objects containing circular references into and from a specialized JSON format.
Read more >TypeError: cyclic object value - JavaScript - MDN Web Docs
TypeError : Converting circular structure to JSON (V8-based) TypeError: cyclic object value (Firefox) TypeError: JSON.stringify cannot ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That doesn’t solve anything. That’s just an easy way out.
Please use
json-stringify-safe
to solve that as I mentioned it before