How to fix Redux error: Minified Redux error #12

3.7k Views Asked by At

I've just upgraded all my react native app packages and now I'm getting this error when running the app in Xcode:

INFO : BSG_KSCrashReport.c (1513): void bsg_kscrashreport_writeStandardReport(BSG_KSCrash_Context *const, const char *const): Writing crash report to /Users/Library/Developer/CoreSimulator/Devices/123/data/Containers/Data/Application/123/Library/Caches/KSCrashReports/foo/foo-123.json
2021-06-23 15:18:32.196550+1000 foo[12206:1933872] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Error: Minified Redux error #12; visit https://redux.js.org/Errors?code=12 for the full message or use the non-minified dev environment for full errors. ', reason: 'Unhandled JS Exception: Error: Minified Redux error #12; visit https://redux.js.org/Errors?code=12 for the full message or use the non-minified dev environment for full errors..., stack:

Redux error 12 state:

The slice reducer for key "" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.

I'm using rematch. If I look at all my generateModel functions they all provide a valid initialState.

Where can I start looking to debug this?

1

There are 1 best solutions below

0
On

I'm a Rematch maintainer, if you want to provide a valid reproduction repo inside Rematch repo or here we'll be happy to help.

Rematch changed a lot internally from v1 to v2, not too much for end users, but probably there's something that you need to fit to make it runnning fine again :)