Skip to content

Allow providing custom JSON stringify functions in SSR state serialization #6614

@mapleeit

Description

@mapleeit

Version

2.3.4

Reproduction link

https://jsfiddle.net/mapleeit/dnh0zpy8/

Steps to reproduce

SSR will use JSON.stringify method stringify initial state to window.__INITIAL_STATE__
but this initial state has circular quote which will throw error like TypeError: Converting circular structure to JSON

Is there any way to avoid this, or only thing I can do is to remove this circular state?

What is expected?

use something like [Circular] to avoid throwing error

What is actually happening?

TypeError: Converting circular structure to JSON


It's not convenient to make minimal reproduction on JSFiddle because of the webpack step.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions