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 persistance errors.

See original GitHub issue

I am getting the following error when using the shopping cart with NextJS. And I am not able to persist the shopping cart data after refresh.

Not sure where the cause lies for these specific errors.

Version 3.0.3

A non-serializable value was detected in an action, in the path: register. Value: [Function: register] Take a look at the logic that dispatched this action: { type: ‘persist/PERSIST’, register: [Function: register], rehydrate: [Function: rehydrate] } (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants) (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Joran-Dobcommented, Oct 27, 2021

Hi @JanKups , So basically now I am just setting the cartDetails to be empty when they are not available yet.

let { redirectToCheckout, cartDetails } = useShoppingCart();
    useEffect(() => {
        if (cartDetails == null || cartDetails.length === 0) {
            cartDetails = { cartDetails: [] };
        }
}, []);
0reactions
dayhaysooscommented, Oct 16, 2022

Hey @andrewjmcgehee, going to be looking into it this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

console.error: "redux-persist failed to create sync storage ...
In redux-persist v6, you try changing as follows: Old config V5 => import storage from 'redux-persist/lib/storage'; const persistConfig ...
Read more >
redux-persist-error-handler - npm
A higher order component to avoid infinite loops when using redux persist with react native. Latest version: 0.1.1, last published: 5 years ...
Read more >
ERROR: Reducer returns undefined for persist/REHYDRATE ...
I'm getting this error in the console: Uncaught Error: Given action "persist/PERSIST", reducer "mealReducer" returned undefined. To ignore an ...
Read more >
Persist state with Redux Persist using Redux Toolkit in React
Redux Persist includes methods that allow us to customize the state that gets persisted and rehydrated, all with an easily understandable ...
Read more >
Uncaught Error: redux-persist: cannot process cyclical state ...
Uncaught Error: redux-persist: cannot process cyclical state. Consider changing your state structure to have no cycles. 333 views.
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