Production Error Codes
When Redux Toolkit is built and running in production, error text is replaced by indexed error codes to save on bundle size. These errors will provide a link to this page with more information about the error below.
All Error Codes
Code | Message |
---|---|
0 | prepareAction did not return an object |
1 | `reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers |
2 | `middleware` field must be a callback |
3 | when using a middleware builder function, an array of middleware must be returned |
4 | each middleware provided to configureStore must be a function |
5 | `enhancers` field must be a callback |
6 | `enhancers` callback must return an array |
7 | each enhancer provided to configureStore must be a function |
8 | The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer |
9 | A case reducer on a non-draftable value must not return undefined |
10 | No insert provided for key not already in map |
11 | `name` is a required option for createSlice |
12 | `context.addCase` cannot be called with an empty action type |
13 | `context.addCase` cannot be called with two reducers for the same action type: type |
14 | The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice |
15 | selectSlice returned undefined for an uninjected slice reducer |
16 | selectState returned undefined for an uninjected slice reducer |
17 | Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation. |
18 | Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`. |
19 | A state mutation was detected between dispatches, in the path ''. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state) |
20 | A state mutation was detected inside a dispatch, in the path: . Take a look at the reducer(s) handling the action . (https://redux.js.org/style-guide/style-guide#do-not-mutate-state) |
21 | Creating or removing a listener requires one of the known fields for matching an action |
22 | Unsubscribe not initialized |
23 | : getOriginalState can only be called synchronously |
24 | The slice reducer for key "" returned undefined when called for selector(). 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. |
25 | original must be used on state Proxy |
26 | `builder.addCase` should only be called before calling `builder.addMatcher` |
27 | `builder.addCase` should only be called before calling `builder.addDefaultCase` |
28 | `builder.addCase` cannot be called with an empty action type |
29 | `builder.addCase` cannot be called with two reducers for the same action type '' |
30 | `builder.addMatcher` should only be called before calling `builder.addDefaultCase` |
31 | `builder.addDefaultCase` can only be called once |
32 | is not a function |
33 | When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax. |
34 | Warning: Middleware for RTK-Query API at reducerPath "" has not been added to the store. You must add the middleware for RTK-Query to function correctly! |
35 | Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup. |
36 | When using custom hooks for context, all hooks need to be provided: .\nHook was either not provided or not a function. |
37 | Warning: Middleware for RTK-Query API at reducerPath "" has not been added to the store. You must add the middleware for RTK-Query to function correctly! |
38 | Cannot refetch a query that has not been started yet. |
39 | called \`injectEndpoints\` to override already-existing endpointName without specifying \`overrideExisting: true\` |
40 | Hooks can only be used in Client Components |