Hi,
I am facing this error message :
One of the sources for assign has an enumerable key on the prototype chain. This is an edge case that we do not support. This error is a performance optimization and not spec compliant.
Here is my code to create store :
const middlewares = [
sagaMiddleware,
thunk
];
const enhancers = [
applyMiddleware(...middlewares),
autoRehydrate()
];
if (__DEV__) {
enhancers.push(devTools());
}
const store = createStore(
createReducer(),
{},
compose(...enhancers)
);
// react-native
persistStore(store, {storage: AsyncStorage});
// Extensions
store.runSaga = sagaMiddleware.run;
Does anyone have an idea for solution please ? Thanks
Seems like there is something strange passed to Object.assign. Does the error come from the persistStore call or is it related to one of your reducers?
I'd love to get to the root of this issue.
Thank you @marvinhagemeister > autoRehydrate() causing the error message, by commenting out : "// autoRehydrate()" the message disappear. What could be wrong ?
@petervavro Due to work constraints, I haven't the time to create a reproducible test-case yet. Is there any chance that you could create a minimal reproducible example?
If you're using immutable.js like me for your store, try swapping redux-persist to redux-persist-immutable, that fixed it for me.
import {persistStore, autoRehydrate} from 'redux-persist-immutable'
馃憤
Open to suggestion / PR for how to detect this scenario and display better error messages. In the meantime I believe this is solved.
Most helpful comment
If you're using immutable.js like me for your store, try swapping redux-persist to redux-persist-immutable, that fixed it for me.
import {persistStore, autoRehydrate} from 'redux-persist-immutable'
https://github.com/rt2zz/redux-persist-immutable