2017-07-24 199 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文件中 –