Open Ashoat opened 6 years ago
@Ashoat encountering the same issue. Can you elaborate on the work around you mentioned? Thanks!
@leggomuhgreggo the short of it is that you just need to make sure the REHYDRATE
action is not in your list of actions.
The JSON file you're importing has an object with a preloadedState
property that has your Redux state at the "start", and a payload
property that has a list of actions that get applied to get the Redux store to the "current" state. But preloadedState
doesn't have to be the initial Redux state, and in practice the full list of actions can be prohibitively long.
The solution here is simply to make sure your list of actions doesn't include a REHYDRATE
action. Have your preloadedState
start after the REHYDRATE
action. Here is how I do it.
@Ashoat the "how I do it" link is 404. I believe you've moved the file to /lib/utils/redux-logger.js
I was using Redux DevTools and this solution did the trick for me: https://stackoverflow.com/a/52128658/3235344
Full error:
This is occurring when I use the "import" function in Redux dev tools. It happens when I simply "export" the current state and then import it. It only occurs if the exported state includes the rehydrate action.
The reason I want this functionality is that I have set up some crash reporting logic that uploads the current Redux state to my server when the app crashes. I can then download a JSON file from my server that I can import into Redux dev tools to investigate the crash.
It's not the biggest deal, as I can avoid it by making sure the
preloadedState
is generated post-rehydrate, and the rehydrate action isn't included in thepayload
. But figured I'd make the issue since the error suggests it :)