leoasis / redux-immutable-state-invariant

Redux middleware that detects mutations between and outside redux dispatches. For development use only.
MIT License
937 stars 37 forks source link

Error after updating state #22

Closed nalumachurakesh closed 7 years ago

nalumachurakesh commented 8 years ago

Hi,

I'm building tree view using d3 visualizations where user can add or remove the nodes from the tree. To build the tree, data is passed in JSON format. I'm updating the JSON object and saving the new values in the store. But after saving I'm getting "Maximum calls stack size exceeded" error.

Please suggest me how to fix this issue.

Thanks.

leoasis commented 8 years ago

Hi @nalumachurakesh!

In order to help you with your problem, do you have a minimum example that reproduces the issue? Some repo that showcases the code, or some jsfiddle or something similar. That way, it'd be easier for me to help you.

Because of the error you are having, seems that you are storing objects in the state that have cycles, which means that some object in the state is referencing some other object, and which in turn references the first one (either directly or indirectly). Maybe that could help you find the issue? Having that kind of state is not supported when using this library (and you will have issues also if you try to serialize the state), so maybe you can check if this is the case or not?

leoasis commented 7 years ago

Closing due to inactivity. Feel free to reopen if you are still having this issue!