-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Cannot read properties of undefined (reading 'type') at Object.addCase (mapBuilders.ts:158:1) #2960
Comments
I'm sorry, we fixed this over in #2885 but did not have a new release yet. |
thanks @phryneas , do we know any expected date to release the fix? Moreover, what i understood from the link is to install the package using this npm i https://pkg.csb.dev/reduxjs/redux-toolkit/commit/9b1acb3d/@reduxjs/toolkit |
Yeah, I'm probably going to try to push out a 1.9.1 in the next day or so with the fixes we do have, and do a 1.9.2 later with any other fixes. |
Great, by the time we are using the package from this Thanks |
@markerikson FYI: getting this error using Uncaught Error: addCase cannot be called with two reducers for the same action type
at Object.addCase (mapBuilders.ts:163:1)
at extraReducers (slice.ts:197:1)
at executeReducerBuilderCallback (mapBuilders.ts:194:1)
at buildReducer (createSlice.ts:341:1)
at reducer (createSlice.ts:370:1)
at redux.js:468:1
at Array.forEach (<anonymous>)
at assertReducerShape (redux.js:466:1)
at combineReducers (redux.js:531:1)
at configureStore (configureStore.ts:162:1) P.S: its working with this npm i https://pkg.csb.dev/reduxjs/redux-toolkit/commit/9b1acb3d/@reduxjs/toolkit |
@m-nathani : a stack trace by itself really isn't helpful. What are you actually trying to do? Can you put together a CodeSandbox, a Github repo, or a Replay ( https://replay.io/record-bugs) that shows this happening? |
i created a stackblitz and appears to be working fine... And after debugging i found a typo on my side by using two rejected case of the same name. It works with |
Cool! Sounds like I can go ahead and close this, then. |
I am Defining a Pre-Typed
createAsyncThunk
As of RTK 1.9, you can define a "pre-typed" version of
createAsyncThunk
that can have the types for state, dispatch, as shown in the usage-with-typescript#createasyncthunkAnd using the above to create a async thunk action as follows:
However i am getting the error as :
P.S: note i dont have two thunks of the same
typePrefix
too...What i am expecting is that all my actions should preload with
AsyncThunkConfig
defined increateAppAsyncThunk
so that i dont have to types for{ signal, rejectWithValue, getState }
in all the thunks.Looking forward to understand whats wrong in the approach or is a bug in
redux-toolkit
?Version:
The text was updated successfully, but these errors were encountered: