Converting circular structure to JSON
See original GitHub issueEnvironment
Please provide as many details as you can:
- Formio.js version: 4.5.1
- Frontend framework: 4.8.1
- Browser: Chrome
- Browser version: latest
Steps to Reproduce
https://angular-formio-custom-demo.netlify.com/
- Add a Table component.
- Add any component. The components will disappear.
- Add any component again. This error message will appear in console:
Infinite loop detected undefined 500
Expected behavior
No error message, no circular reference.
Observed behavior
Circular reference, error message in console.
I cannot reproduce our issue with the demo app (only the infinite loop), but internally we get this error message:
Uncaught TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
--- property 'component' closes the circle
at JSON.stringify (<anonymous>)
at fastCloneDeep (utils.js:1350)
at TableComponent.get (Component.js:2883)
at get (<anonymous>)
at TableComponent.get (NestedComponent.js:730)
at get (<anonymous>)
at TableComponent.get (Table.js:85)
at Webform.js:1783
at NestedComponent.js:198
at arrayEach (lodash.js:516)
Example
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
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 - Stack ...
TypeError: Converting circular structure to JSON. It seems that I can get the object logged to the console by using just plain: console.log(object)....
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: 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 >How to print a circular structure in a JSON like format using ...
The circular structure is when you try to reference an object which directly or indirectly references itself. ... Here you can easily resolve...
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 FreeTop 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
Top GitHub Comments
@travist FYI I realized the issue, in this case, was I saved the form to a local model and I passed back to the formio component.
So the fix for my demo is: https://github.com/merobal/angular-formio-custom-demo/commit/1a4a96280637b986997388e05aa2662d71e957fd
FYI https://github.com/formio/angular-formio/issues/509 @ullas1989 FYI https://github.com/formio/angular-formio/issues/507 @dmenne
Thanks for the bump… I will ensure this is added to a developer on our teams list this week, or maybe early next week.