Skip to content
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

StoreEnhancer does not when using Redux toolkit #2829

Closed
1 task
pantos27 opened this issue Aug 18, 2020 · 3 comments · Fixed by #2834
Closed
1 task

StoreEnhancer does not when using Redux toolkit #2829

pantos27 opened this issue Aug 18, 2020 · 3 comments · Fixed by #2834
Assignees

Comments

@pantos27
Copy link

Package + Version

"@sentry/react": "^5.21.1"

Description

When integrating with a project that uses react+redux+redux+redux-toolkit there is a type mismatch when creating the store with configureStore()
The StoreEnhancer type does not match between the on in sentry/react and the one in reduxjs/toolkit

Error message:
TS2322: Type 'StoreEnhancer<Record<string, unknown>, never>' is not assignable to type 'StoreEnhancer<{}, {}>'.
Types of parameters 'next' and 'next' are incompatible.
Types of parameters 'preloadedState' and 'preloadedState' are incompatible.
Type 'PreloadedState | undefined' is not assignable to type 'import(".../node_modules/redux/index").PreloadedState | undefined'.
Type 'PreloadedState' is not assignable to type 'PreloadedState | undefined'.
Type '(S extends CombinedState ? { [K in keyof S1]?: (S1[K] extends Record<string, unknown> ? PreloadedState<S1[K]> : S1[K]) | undefined; } : never) | { [K in keyof S]: S[K] extends string | ... 2 more ... | symbol ? S[K] : PreloadedState<...>; }' is not assignable to type 'PreloadedState | undefined'.
Type 'S extends CombinedState ? { [K in keyof S1]?: (S1[K] extends Record<string, unknown> ? PreloadedState<S1[K]> : S1[K]) | undefined; } : never' is not assignable to type 'PreloadedState | undefined'.
Type '{}' is not assignable to type 'PreloadedState'.
Type 'S extends CombinedState ? { [K in keyof S1]?: (S1[K] extends Record<string, unknown> ? PreloadedState<S1[K]> : S1[K]) | undefined; } : never' is not assignable to type 'PreloadedState'.
Type 'PreloadedState' is not assignable to type 'import(".../node_modules/redux/index").PreloadedState'.

@pantos27
Copy link
Author

@jennmueng @AbhiPrasad @HazAT looking on the source files of 5.21.3 the return type is still StoreEnhancer in redux.d.ts.map

@HazAT
Copy link
Member

HazAT commented Aug 24, 2020

Sorry about that, we are on it.

@HazAT
Copy link
Member

HazAT commented Aug 24, 2020

5.21.4 fixed it @pantos27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants