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

Compile Error with TypeScript 2.4.1 #434

Closed
2 of 9 tasks
kiwikern opened this issue Jul 5, 2017 · 7 comments
Closed
2 of 9 tasks

Compile Error with TypeScript 2.4.1 #434

kiwikern opened this issue Jul 5, 2017 · 7 comments

Comments

@kiwikern
Copy link

kiwikern commented Jul 5, 2017

This is a...

  • feature request
  • bug report
  • usage question

What toolchain are you using for transpilation/bundling?

  • @angular/cli
  • Custom @ngTools/webpack
  • Raw ngc
  • SystemJS
  • Rollup
  • Other

Environment

NodeJS Version: 6.10.3
Typescript Version: 2.4.1
Angular Version: 4.2.5
@angular-redux/store version: 6.5.4
@angular/cli version: 1.1.2
OS: Windows 10

Actual Behaviour:

After updating typescript to 2.4.1, I got a compile error for MockObservableStore. I could resolve this by adding "skipLibCheck": true to my tsconfig.json (just a workaround though)
Seems to be similar to angular/angular#17800

Stack Trace/Error Message:

ERROR in D:/workspace/superfitschedule/node_modules/@angular-redux/store/lib/testing/observable-store.mock.d.ts (21,22): Class 'MockObservableStore<State>' incorrectly implements interface 'ObservableStore<any>'.
  Types of property 'configureSubStore' are incompatible.
    Type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => MockObservableStore...' is not assignable to type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => ObservableStore<Sub.
..'.
      Type 'MockObservableStore<SubState>' is not assignable to type 'ObservableStore<SubState>'.
        Types of property 'configureSubStore' are incompatible.
          Type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => MockObservableStore...' is not assignable to type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => ObservableStor
e<Sub...'.
            Type 'MockObservableStore<SubState>' is not assignable to type 'ObservableStore<SubState>'.
              Types of property 'configureSubStore' are incompatible.
                Type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => MockObservableStore...' is not assignable to type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => Observab
leStore<Sub...'.
                  Type 'MockObservableStore<SubState>' is not assignable to type 'ObservableStore<SubState>'.
                    Types of property 'dispatch' are incompatible.
                      Type '(action: Action) => Action' is not assignable to type 'Dispatch<SubState>'.
                        Type 'Action' is not assignable to type 'A'.
@SethDavenport
Copy link
Member

I'll take a look on saturday

@BendingBender
Copy link

There is also an error in ./node_modules/@angular-redux/store/lib/testing/ng-redux.mock.d.ts:12:22:

    TS2415: Class 'MockNgRedux' incorrectly extends base class 'NgRedux<any>'.
  Types of property 'configureSubStore' are incompatible.
    Type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => MockObservableStore...' is not assignable to type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => ObservableStore<Sub...'.
      Type 'MockObservableStore<SubState>' is not assignable to type 'ObservableStore<SubState>'.
        Types of property 'configureSubStore' are incompatible.
          Type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => MockObservableStore...' is not assignable to type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => ObservableStore<Sub...'.
            Type 'MockObservableStore<SubState>' is not assignable to type 'ObservableStore<SubState>'.
              Types of property 'configureSubStore' are incompatible.
                Type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => MockObservableStore...' is not assignable to type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => ObservableStore<Sub...'.
                  Type 'MockObservableStore<SubState>' is not assignable to type 'ObservableStore<SubState>'.
                    Types of property 'configureSubStore' are incompatible.
                      Type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => MockObservableStore...' is not assignable to type '<SubState>(basePath: (string | number)[], localReducer: Reducer<SubState>) => ObservableStore<Sub...'.
                        Type 'MockObservableStore<SubState>' is not assignable to type 'ObservableStore<SubState>'.
                          Types of property 'dispatch' are incompatible.
                            Type '(action: Action) => Action' is not assignable to type 'Dispatch<SubState>'.
                              Type 'Action' is not assignable to type 'A'.

@SethDavenport
Copy link
Member

Give @angular-redux/[email protected] a try.

@SethDavenport
Copy link
Member

Also note that I have a fix to make to @angular-redux/router as well, if you're using that. I'll take care of that tomorrow (see angular-redux/router#17).

@kiwikern
Copy link
Author

kiwikern commented Jul 9, 2017

Works for me. Thanks for the quick fix! 🙂 👍

@SethDavenport
Copy link
Member

Great!

@banderberg
Copy link

I get this same error with TypeScript 2.5.3 using @angular-redux/store 6.5.7.

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

No branches or pull requests

4 participants