Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

error TS2415: Class 'WebSocketSubject<T>' incorrectly extends base class 'AnonymousSubject<T>'. #214

Open
sacafrprof opened this issue Oct 11, 2017 · 1 comment

Comments

@sacafrprof
Copy link

Description

Hi I tried your generator today and I had the error below when running gulp serve or gulp test :

Error Message & Stack Trace

ERROR in C:\Users\Romain\IdeaProjects\test\node_modules\rxjs\observable\dom\WebSocketSubject.d.ts
(23,22): error TS2415: Class 'WebSocketSubject<T>' incorrectly extends base class 'AnonymousSubject<T>'.
  Types of property 'lift' are incompatible.
    Type '<R>(operator: Operator<T, R>) => WebSocketSubject<R>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<T>'.
      Type 'WebSocketSubject<R>' is not assignable to type 'Observable<T>'.
        Types of property 'operator' are incompatible.
          Type 'Operator<any, R>' is not assignable to type 'Operator<any, T>'.
            Type 'R' is not assignable to type 'T'.

Config

{
  "generator-fountain-angular2": {
    "version": "1.0.0",
    "props": {
      "framework": "angular2",
      "modules": "webpack",
      "js": "typescript",
      "ci": "",
      "css": "scss",
      "resolved": "C:\\Users\\Romain\\AppData\\Roaming\\npm\\node_modules\\generator-fountain-webapp\\node_modules\\generator-fountain-angular2\\generators\\app\\index.js",
      "namespace": "fountain-angular2:app",
      "_": [],
      "sample": "todoMVC",
      "router": "router"
    }
  }
}

Environment

(it is strange node says I'm on win32 but I'm on a Windows 10 64 bits plateform an use an node x64 version).

> node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' '
+ os.release())"
Node.js v6.11.4
win32 10.0.15063

> yo --version
2.0.0

> npm --version
3.10.10

Solution

I had to lower my TypeScript version from 2.5.3 to 2.3.4 as suggested here : angular/angular#17800

I didn't tried other versions of TypeScript or tested the whole project with this version, but gulp serve works for me.

Romain.

@r0main
Copy link

r0main commented Oct 11, 2017

Adding a comment with my other account. Sorry I posted with the wrong account.

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

No branches or pull requests

2 participants