question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

redux-persist:cannot process cyclical state

See original GitHub issue

Hey,I encounter a problem like this:

      redux-persist:cannot process cyclical state.
      Consider changing your state structure to have no cycles.
      Alternatively blacklist the corresponding reducer key.
      Cycle encounted at key "context" with value "[object Object]"

And my state structure is:

    {
          "activeConversation": "223sssse234234",
          "client": IMClient, // object
          "convById": Map()   // Map, store the conversation object
          "msgById": Map()    // Map, store the message object
          convListSortedByUpdatedTimeList(), // store the message ids
    }

so how can I resolve the problem? I need your help,thank you!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
leticiacostadiascommented, Aug 8, 2018

I’ve been having basically the same issue, I’m having the log that follows:

redux-persist: cannot process cyclical state.
      Consider changing your state structure to have no cycles.
      Alternatively blacklist the corresponding reducer key.
      Cycle encounted at key "0" with value "5978ab989c24c60015f1a81c".

Where 0 is the first position of an array and 5978ab989c24c60015f1a81c is a id from my mongodb. This is being stored like this:

"data": {
     ...,
      "wallets": [
        {
          "label": String,
          "operational_settings": {
            "automatic_balance": Boolean
          },
          "user_id": userId,
          "accounts": [
            "5978ab989c24c60015f1a81c"
          ],
          "created_at": ISODate
        }
      ]
}

Any idea of what I may be doing wrong?

1reaction
raphaelrkcommented, Mar 24, 2018

I was storing my react-navigation current navigation state in the redux store and that was somehow causing a cycle. Changed it to only store the current route name

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught Error: redux-persist: cannot process cyclical state ...
So, I'm using redux-offline (which uses redux-persist) in my project, and am having an issue with action payload/firebase results being non-serialized (See ...
Read more >
redux-persist cannot process cyclical state in bundled android ...
I've been working on a react-native app and have been running it on both IOS and Android simulators as well as on devices...
Read more >
TypeError: cyclic object value - JavaScript - MDN Web Docs
The JavaScript exception "cyclic object value" occurs when object references were found in JSON. JSON. stringify() doesn't try to solve them ...
Read more >
Reduxpersist/Createpersistoid: Error Serializing State Typeerror
The JavaScript exception cyclic object value occurs when object references were found in JSON. JSON.stringify doesn't try to solve them and fails. Contribute...
Read more >
The redux best practice "Do Not Put Non-Serializable Values ...
Actually, redux-persist documentation explains that they are not able to persist ... Well, you certainly cannot use the Set's add method, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found