-
-
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
Upgrading from version 2.0.1 to 2.1.0 or 2.2.0 breaks vite build with TS (TS7006) errors #4200
Upgrading from version 2.0.1 to 2.1.0 or 2.2.0 breaks vite build with TS (TS7006) errors #4200
Comments
could you give an example of a piece of code which now errors? |
const user = useAppSelector(selectedUser) user?.uid used to work properly not errors but now the new versions says that user is any but the selector was created from a proper type. |
Funny enough the selector is now returning unknown, which force the error on build |
any chance you could put together a reproduction in typescript playground, codesandbox or a repo? none of our tests broke 😕 |
Actually I think the issue is coming from createDrafSafeSelector the function does not detect the original type returning any or unknown |
could you show how you're using it? |
Sorry about no been able to provide a proper example, I am behind a proxy so cannot copy and paste the real code. store/Index.ts const selectOriginalThing = (state: Rootstate) => state.myState.thing; (thing is properly typed as Type? from slice) export const selectThing = createDraftSafeSelector(selectOriginalThing, (thing) (here is the type error, thing is now “any” instead of inferring type from selectOriginalThing |
5.3.3 |
not sure what to suggest at this point then, sorry - without a replication i can't really look into it further |
I had the same issue, I removed the package and then deleted node_modules, after which I installed the package again and it worked |
The problem is probably that you have a store slice which use a strongly typed app-specific dispatch. Things tend to become, literally, a bit loopy in those type of scenarios unless you very, very carefully order your imports in meticulous ways and ensure that type-only references are imported with |
I had a similar error
and was able to fix it by updating the Similar to @AlbericoD I just removed and re-added rtk... yarn remove @reduxjs/toolkit
yarn add @reduxjs/toolkit |
I think the issue here is that the new |
Ah, yes, we should definitely do that now! |
@markerikson Yessirrr. #4400. |
Out in 2.2.4. |
Hi Team
I just upgraded to version 2.2.0 and the change creates those this really weird issue, I am not changing anything on my tsconfig and eslinyrc and suddenly running vite build throws more than 600 implicit any type
Have anyone seen these before?
The text was updated successfully, but these errors were encountered: