-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Class 'NgRedux<RootState>' incorrectly implements interface 'ObservableStore<RootState>' #3466
Comments
I'm receiving this error because in my package.json i have redux version strictly set to 4.0.1, I'm also using I tried updating redux to version 4.0.2 to resolve duplicating, but even tho it's patch version it introduced breaking changes caused by #3411 i believe, so in 4.0.2 i just have type errors like: I resolved this issue for now, by adding "resolutions": {
"redux": "4.0.1"
} but it would be nice to get this types fixed. yarn 1.12.1 |
Similar issue with React (16.8.6) / Redux (4.0.2) / TypeScript (3.5.3) :
|
Full error messages :
|
Same error with redux 4.0.2 and @angular-redux/store (v 10 or 9). Inside node_modules@angular-redux\store\components\observable-store.d.ts Inside node_modules\redux\index.d.ts at line 248 of redux 4.0.2, there is: This line is not present in redux 4.0.1 and it seems dependent libraries aren't aware of it, hence the compilation error... |
@timdorr sure check out this repo i quickly made to reproduce the issue https://github.com/MhMadHamster/redux-types-problem-poc |
Thanks everyone. I'm digging in right now. |
Two observations from the sideline:
|
@MhMadHamster The
Upgrading to 4.0.2 to align all the versions together makes this particular bug go away:
I would advise others to do the same. Still looking at the combineReducers issue. That may just need a straight up revert. |
@markerikson The types still work, just not between different versions of them. It's similar to switching from the legacy Context API. If you used connect from one version and Provider from another, of course that's not going to work. This isn't a breaking change, it's just broken. |
I just did the #3411 revert: #3467. Unfortunately, we have no tests that cover the type parameters of And we definitely need tests that cover those params (all params, really). Edit: @MhMadHamster I can confirm that revert fixes your particular test case. I'll release that as 4.0.3 shortly. |
Pushed 4.0.3 now: https://github.com/reduxjs/redux/releases/tag/v4.0.3 |
@timdorr Thanks! |
At the very least, this brings to light a potential risk in your project, where you are using different versions of the types for the same package. That's something you should fix, especially when dealing with external types (like DT) where a type version might be tied to a different library version than what you are using. It ultimately comes down to how something like @types/react-redux selects the redux version (caret selection) and how you do it (exact versioning). That's not a TS or semver or Redux issue, that's just how npm resolves dependencies and how the node module resolution algorithm can be a problem sometimes. This is actually something we're dealing with on React Router, where we have two packages and have switched from legacy to modern React Context. We've had a lot of issues where folks have mixed versions of react-router and react-router-dom. It's nothing the library can/should fix, so we just have to let folks know every time they run into it. I wish I had a better answer for this. For now, you can either lock your dep resolutions, open up your version selector, or just keep your lockfile as-is to prevent version changes. Outside of never making changes to our types, there isn't really anything we can do to prevent or fix this. |
I think it has to do with the dependencies, using redux 4.0.2 doesn't work with the present @angular-redux, |
Yes, I can confirm that redux@4.0.1 works with latest @angular-redux. |
redux@4.0.1 worked for me . |
redux@4.0.1 worked for me too. Thanks all.. |
I'm seeing this issue on redux 4.0.3, should I downgrade? |
Seeing it on |
Downgrading to redux@4.0.1 will resolve this issue. |
I got this error when tried to configure angular-redux/store with my app, the app is still serving, i looked at the node module folder under the angular-redux folder at ng-redux.ts:
been trying to fix it for a while now |
I have this error, how could I fix it. ERROR in ../node_modules/@angular-redux/store/components/ng-redux.d.ts:10:31 - error TS2420: Class 'NgRedux' incorrectly implements interface 'ObservableStore'. 10 export declare abstract class NgRedux implements ObservableStore {
|
Thank you!!!! Initially, I tried to downgrade to 4.0.1 by changing it in the package.json, then issuing a generic
|
Thanks for this, that solved my issue |
I'm upgrading from Angular 5 to Angular 8, and have updated ng-redux to 4.0.1. Is the following compile error related to this topic?
If so, how to fix? |
I tried the solutions before, but this was the worked for me. Thanks! |
This cannot be different than changing the dependency in package.json and running |
redux@4.0.1 worked for me too. Thanks all.. |
~7 hours ago a new Redux 4.0.2 was released.
but there is no backward compatibility with current running code.
We had redux : ^4.0.0.
therefore, when running on 4.0.1 everything was OK
but from today all our builds are failing due to the following message:
The text was updated successfully, but these errors were encountered: