Closed ondrej-langr closed 3 years ago
@daichi-ranguru Hi! The default serialization strategy assumes you have an object that can be passed to JSON.stringify
. Circular references break JSON.stringify
so you need to either fix that on your end (removing circular refs in your initialState
object), or overwrite the default serialization strategy.
To overwrite it, there's a hook mentioned here where you can use something like devalue. Hope that helps!
@frandiox Hey! Glad to hear from you this quickly - writing my custom hook helped! Ill leave this here for future if someone gets this error too, but somehow didnt figure it out from docs.
Thanks again!
Hey comunity!
I found myself in weird position where I found something that may be a bug(?) - namely: When this plugin tries to stringify state (in utils/state.js) that is then injected to FE, the JSON.stringify throws and error that theres circular structure.
It throws error like this:
Should it use flatted package or have something like this?
Open to make a PR myself! Thanks.