Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Converting circular structure to JSON #2

Open
tloriato opened this issue Oct 28, 2019 · 1 comment
Open

TypeError: Converting circular structure to JSON #2

tloriato opened this issue Oct 28, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@tloriato
Copy link

tloriato commented Oct 28, 2019

valueBuf = Buffer.from( JSON.stringify(value) );

When trying to store structures like AVL Trees and others that reference "themselves", the Stringify function throws this error. There's an option when calling the function to avoid this error, but I'm not sure how it impacts the rest of its usage in this module.

@jhuckaby
Copy link
Owner

Yeah, this is a known issue with JSON. There is actually a lot of things doesn't support, including circular references, functions, blessed objects (classes), and more. I'm afraid there isn't much I can do, unless I pull in a 3rd party library, which would slow down the JSON stringify/parse.

I will leave this issue open until I can figure out a solution, but I don't see how I can do it while keeping up the performance level.

@jhuckaby jhuckaby added the bug Something isn't working label Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants