We are working on an Open Source Chrome extension: Digital Assistant Client
We are trying to record the user click by converting the clicked node to json with domJson library and we are stringifying the json. While stringifying in some angular websites we are getting error as follows
Unhandled Promise rejection: Converting circular structure to JSON --> starting at object with constructor 'Object' | property 'blueprint' -> object with constructor 'Array' --- index 1 closes the circle ; Zone: ; Task: Promise.then ; Value: TypeError: Converting circular structure to JSON --> starting at object with constructor 'Object' | property 'blueprint' -> object with constructor 'Array' --- index 1 closes the circle
We tried to use the following extensions
https://www.npmjs.com/package/flatted
https://www.npmjs.com/package/circular-to-json
But we are unable to resolve the issue. Can anyone help us on how we can stringify the domNodes which has circular references to parent objects and so on.