Open evmar opened 7 years ago
cc @david-driscoll
@evmar you should try 6.0.0-alpha.0, it targets TS 2.3. (in the next
branch)
isn't this rxjs 4 repo?
Sounds like it's related to https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#typescript-24 without digging into it much.
This appears to be revealing a few issues like not giving the full type DefaultIfEmptyOperator
and a few other bits. That said using rxjs as a library shouldn't have a big impact if you're using it as a module, not compiling it as a third party.
Also related to the 2.4 changes is https://github.com/Microsoft/TypeScript/issues/16593.
I'm getting these on 2.4.1
now:
[at-loader] ./node_modules/rxjs/Subject.d.ts:16:22
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'.
[at-loader] ./node_modules/rxjs/observable/dom/WebSocketSubject.d.ts:24:22
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'.
@benlesh - is the recommended solution to not upgrade at this point?
@evmar @amcdnl @benlesh should this be moved over to ReactiveX/rxjs? I think having this here is going to be confusing for incoming readers.
Yes.
Ran into the same issue just now, downgrading typescript for now resolve the compilation error. Glad I came across this issue 👍
@evmar or @mattpodwysocki do you mind closing?
Sorry, I lack context. Is the issue fixed?
My understanding is that the issue will be fixed in RxJS 6.0. The signature hasn't been corrected in 5.x.
This issue is not related to this repository. RxJS 5 and later is a different repository. See my link earlier, I'm trying to minimize people coming here and expecting to get help on a repo that is in maintenance mode.
I'm confused about the whole ReactiveX/rxjs
vs Reactive-Extensions/RxJS
thing. Better descriptions for the two repositories would be very helpful.
@claudiuconstantin There are now warnings/notices all over the RxJS 4 readme and docs (reactive-extensions)
I do not see that it is resolved at all. Observable and Subject are still not assignable.
Type 'Observable
@mattpodwysocki can you please close this, as we're in the wrong repo lol
@raysuelzer ... you've got a classic typed-language problem there... AsyncSubject inherits from Observable, not the other way around. So you can't pass an Observable where AsyncSubject is expected.
I have an error in switchMap operator:
export class AvailableStoreTypesLoadedEffect {
constructor(private actions$: Actions,
private service: AvailableService) {
}
@Effect()
AvailableStoreTypesLoadedEffect$ = this.actions$
.ofType(FETCH_AVAILABLE_STORE_TYPES)
.pipe(
switchMap(action => this.service.fetchAvailableStoreTypes()),//Error:(22, 9) TS2684:The 'this' context of type 'void' is not assignable to method's 'this' of type 'Observable<{}>'.
map(res => new AvailableStoreTypesLoaded(res))
);
}
I tried with:
Observable.of({})
.pipe(
switchMap(() => Observable.of({}))//Error:(22, 9) TS2684:The 'this' context of type 'void' is not assignable to method's 'this' of type 'Observable<{}>'.
);
but I get the same error.
My environment is:
angular 5.0.3
typescript 2.4.2
rxjs 5.5.2
@yamidvo Please see the above conversation. This repo does not support RxJS 5 and above.