FountainJS / generator-fountain-webapp

Yeoman 'fountain' generator to start a webapp
http://fountainjs.io
MIT License
963 stars 67 forks source link

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

Open sacafrprof opened 7 years ago

sacafrprof commented 7 years ago

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 : https://github.com/angular/angular/issues/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 commented 7 years ago

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