Converting circular structure to JSON error
See original GitHub issueHello,
First of all, thank you for the great product. It’s pleasure to create fancy CLI output using it.
In recent versions, we faced a problem when an error happening in a listr task. If context contains objects with circular reference, another error throws by JSON.stringify
: Converting circular structure to JSON
.
It goes from cloneObject
function:
at cloneObject (/~/Dash/dashmate/node_modules/listr2/dist/utils/general.js:8:28)
at TaskWrapper.report (/~/Dash/dashmate/node_modules/listr2/dist/lib/task-wrapper.js:50:104)
at Task.run (/~/Dash/dashmate/node_modules/listr2/dist/lib/task.js:266:29)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /~/Dash/dashmate/node_modules/p-map/index.js:57:22
I would recommend to use lodash’s cloneDeep
or alternatives instead of JSON.parse(JSON.stringify)
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 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 >Converting Circular Structure to JSON - Career Karma
Error When Trying to Convert Circular Structures into JSON ... JSON does not support object references, so trying to stringify a 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 >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 >Converting circular structure to JSON" error occurs when a ...
Steps to reproduce: ... Current results: The "Uncaught TypeError: Converting circular structure to JSON" or "Maximum call stack error" error ...
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
🎉 This issue has been resolved in version 3.13.2 🎉
The release is available on:
Your semantic-release bot 📦🚀
Hi!
We have functions that allow modifying tasks inside. Functions return task bodies (so object with
title
,task
, e.t.c.)And so this error comes up.