Skip to main content

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

CodeMessage
0prepareAction 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
3when using a middleware builder function, an array of middleware must be returned
4each middleware provided to configureStore must be a function
5`enhancers` field must be a callback
6`enhancers` callback must return an array
7each enhancer provided to configureStore must be a function
8The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer
9A case reducer on a non-draftable value must not return undefined
10No 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
14The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice
15selectSlice returned undefined for an uninjected slice reducer
16selectState returned undefined for an uninjected slice reducer
17Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.
18Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.
19A 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)
20A 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)
21Creating or removing a listener requires one of the known fields for matching an action
22Unsubscribe not initialized
23: getOriginalState can only be called synchronously
24The 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.
25original 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
33When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.
34Warning: 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!
35Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup.
36When using custom hooks for context, all hooks need to be provided: .\nHook was either not provided or not a function.
37Warning: 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!
38Cannot refetch a query that has not been started yet.
39called \`injectEndpoints\` to override already-existing endpointName without specifying \`overrideExisting: true\`
40Hooks can only be used in Client Components