Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forkJoin(Promise) "You provided 'null' where a stream was expected" #4737

rubenprins opened this issue Apr 26, 2019 · 0 comments


Copy link

commented Apr 26, 2019

Bug Report

Current Behavior
After #4640, forkJoin(promise) throws an error

You provided 'null' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.

Note that this only happens if you provide forkJoin with a single argument of type Promise.


forkJoin(Promise.resolve('hello')).subscribe(result => console.log(result));

Expected behavior
forkJoin(promise) should behave the same as forkJoin([promise]), like it does for Observable.


  • RxJS version: 6.5.1

Possible Solution
Don't just check for isObservable, but also isPromise (and strictly speaking, check for Iterable too).

if (isObject(first) && !isObservable(first)) {

should become

if (isObject(first) && !isObservable(first) && !isPromise(first) && !isIterable(first)) 
cartant added a commit to cartant/rxjs that referenced this issue Apr 26, 2019
cartant added a commit to cartant/rxjs that referenced this issue Apr 26, 2019
@cartant cartant added the type: bug label Apr 26, 2019
@benlesh benlesh closed this in c11e1b3 May 2, 2019
BioPhoton added a commit to BioPhoton/rxjs that referenced this issue May 15, 2019
* test(forkJoin): add failing test for ReactiveX#4737

* fix(forkJoin): test for object literal not observable

Closes ReactiveX#4737.
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
2 participants
You can’t perform that action at this time.