"Uncaught TypeError: Converting circular structure to JSON"
See original GitHub issueI 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:
Here is the stacktrace:
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:
- Created 6 years ago
- Reactions:3
- Comments:14 (6 by maintainers)
Top 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 >
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
@workmanw cool I’ll revert it when I get out of work later today
I was able to reproduce this by adding a
fragmentArray
to a nestedfragment
. 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