2017-07-24 113 views
1

我已經從Angular 2最新版本Angular 4升級,當我嘗試運行應用程序並獲取低於警告消息時。有人可以就此提出建議。Angular 4問題

node_modules/rxjs/Subject.d.ts(16,22): error TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'. 
    Types of property 'lift' are incompatible. 
    Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'. 
     Type 'Observable<T>' is not assignable to type 'Observable<R>'. 
     Type 'T' is not assignable to type 'R'. 
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'. 
+0

它看起來像一個已知的問題。這裏有幾個潛在的修復:https://github.com/angular/angular/issues/17800 –

回答

1

這是打字稿泛型類型的問題checking.Revert從2.4.x的您的打字稿版本2.3.2

https://github.com/ReactiveX/rxjs/issues/2701

+1

謝謝,下面的變化解決了Angular的這個問題。電梯(運營商:運營商):可觀測; 電梯(運營商:運營商):可觀測; - 在rxjs - subject.d.ts文件中 –