question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

26reactions
kyriediculouscommented, Nov 30, 2017

That doesn’t solve anything. That’s just an easy way out.

10reactions
Khaledgarbayacommented, Nov 30, 2017

Please use json-stringify-safe to solve that as I mentioned it before

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found