Subscribe on changes!

JSON.stringify on computed gives error about cyclic value

avatar
Feb 14th 2022

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Call JSON.stringify on any computed (without .value)

What is expected?

Not actually sure if this should be expected to work or not ...

What is actually happening?

You get "TypeError: cyclic object value" (Firefox)/"TypeError: Converting circular structure to JSON" (Chrome)


Seems similar to https://github.com/vuejs/core/issues/1916, but affects recent Chrome/Firefox on PC

avatar
Feb 14th 2022

Yeah well, it's never a good idea to pass a complex/stateful object to stringify.

I would not cosndier this a bug. You want to stringify the value, not the computed itself.