You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
devtools with option serialize.immutable does not deserialize state from devtools correctly (broken redux devtools "Jump" / "Revert" etc.) #2560
This works fine for serializing: redux-devtools will show ImmutableSet if zustand store was created with this option.
However, it breaks with deserializing during JUMP_TO_ACTION, REVERT and other devtools options, when used with zustand.
With zustand, the state doesn't get deserialized correctly, so the next time the store is used, the code will receive the wrong data type.
This problem does not occur with redux.
My reproduction is based on the zustand demo.
To show the problem, the number counter has been replaced by a growing Immutable.Set.
To display it, I JSON.stringify the Immutable.Set (Immutable handles JSON stringification, so it shows as array).
The demo creates 2 stores; one for redux and one for zustand; each with devtools.
The counter button has been duplicated:
on the left there is a button for the redux store.
on the right there is a button for the zustand store.
The stores both work until the devtools are used to jump.
When jumping, the redux store continues to work, but the zustand store breaks.
Once the state is broken, JSON stringification shows a JS object which represents the serialized JSON encoding in the redux-devtools.
Here's a video:
zustand-devtools-bug.mp4
Check List
Please do not ask questions in issues.
I've already opened a discussion before opening this issue, or already discussed in other media.
Activity