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.

"Uncaught TypeError: Converting circular structure to JSON"

See original GitHub issue

I have a fairly complex fragment model that upon successful save throws the error Uncaught TypeError: Converting circular structure to JSON.

Here is a screenshot of the place it occurs:

screenshot 2017-04-05 16 16 34

Here is the stacktrace:

screenshot 2017-04-05 16 19 10

Sorry for the images, it was the easiest way I could think to share the most info. I am working on a demo project to reproduce this issue. It seems to happen because this._inFlightAttributes is using not JSON.stringify-able. The model itself is a Fragment.extend model with many nested fragment/fragmentArray and regular DS.attr properties.

Using the latest stable Ember (2.12) and the latest release of ember-data-model-fragments.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
jakesjewscommented, May 9, 2017

@workmanw cool I’ll revert it when I get out of work later today

2reactions
erkiecommented, Apr 11, 2017

I was able to reproduce this by adding a fragmentArray to a nested fragment. This branch fails the same way we are seeing in production:

https://github.com/lytics/ember-data-model-fragments/compare/master...erkie:cyclic-json-error

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Converting circular structure to JSON - Stack ...
It means that the object you pass in the request (I guess it is pagedoc ) has a circular reference, something like: var...
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. To solve...
Read more >
Converting Circular Structure to JSON - Career Karma
JSON does not support object references, so trying to stringify a JSON object that references itself will result in a typeerror. It is...
Read more >
How to fix TypeError: Converting circular structure to JSON in ...
To fix this error, you need to make sure that your objects don't contain circular references. One way to do this is to...
Read more >
TypeError: Converting circular structure to JSON and ...
TypeError: Converting circular structure to JSON and Uncaught (in promise) TypeError: this.activeCallback is not a function ... When you ask a ...
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