rt2zz / redux-persist

persist and rehydrate a redux store
MIT License
12.9k stars 862 forks source link

RangeError: Maximum call stack size exceeded #1441

Closed mantegnous closed 1 year ago

mantegnous commented 1 year ago

I'm trying to combine two reducers and exclude some values from persist, i followed the doc code, it work but.. when i do a dispatch that write in my state i have this error

RangeError: Maximum call stack size exceeded

`import { combineReducers, configureStore } from '@reduxjs/toolkit'
import authReducer from './slices/authSlice'
import { persistReducer, persistStore } from 'redux-persist';

import storage from 'redux-persist/lib/storage';

const rootPersistConfig = {
    key: 'root',
    storage: storage,
    blacklist: ['auth']
}

const authPersistConfig = {
    key: 'auth',
    storage: storage,
    blacklist: ['loading','error','success']
}

const rootReducer = combineReducers({
    auth: persistReducer(authPersistConfig, authReducer),
})

const persistReducers = persistReducer(rootPersistConfig, rootReducer)

export const store = configureStore({
    reducer: persistReducers,
    middleware: getDefaultMiddleware =>
        getDefaultMiddleware({
            serializableCheck: false,
        }),

})

export const persistor = persistStore(store)
`

i dont know where is the error