You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this bug by using combineLatest in the following way (you can run this in a REPL for example)
const { combineLatest, of } = require('rxjs')
combineLatest([of(0), undefined]).subscribe()
which gives the corresponding stacktrace:
TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.
at Object.createInvalidObservableTypeError (<path-to-my-project>/node_modules/rxjs/dist/cjs/internal/util/throwUnobservableError.js:5:12)
at Object.innerFrom (<path-to-my-project>/node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js:93:36)
at Object.from (<path-to-my-project>/node_modules/rxjs/dist/cjs/internal/observable/from.js:7:78)
at <path-to-my-project>/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js:42:41
at maybeSchedule (<path-to-my-project>/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js:72:9)
at _loop_1 (<path-to-my-project>/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js:41:17)
at <path-to-my-project>/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js:61:17
at maybeSchedule (<path-to-my-project>/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js:72:9)
I'm ok with the error itself, but I'm not ok with the fact that the stacktrace sits entirely within the RxJS library. The issue becomes problematic in a codebase which is very large and uses RxJS extensively because it gives literally nowhere to start when the time comes to figure out which call of combineLatest caused the issue. In fact, from that stacktrace, it's not even clear that it's a call to combineLatest that caused the issue, since the only indication I have here is that combineLatest.js appears somewhere in the stacktrace.
Expected behavior
I would expect the following code
const { combineLatest, of } = require('rxjs')
combineLatest([of(0), undefined])
(without subscription) to throw the following:
TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.
at <location in my code, not in the RxJS library>
at <rest of the stacktrace>.
Reproduction code
const{ combineLatest, of }=require('rxjs')combineLatest([of(0),undefined])
Describe the bug
I noticed this bug by using
combineLatest
in the following way (you can run this in a REPL for example)which gives the corresponding stacktrace:
I'm ok with the error itself, but I'm not ok with the fact that the stacktrace sits entirely within the RxJS library. The issue becomes problematic in a codebase which is very large and uses RxJS extensively because it gives literally nowhere to start when the time comes to figure out which call of
combineLatest
caused the issue. In fact, from that stacktrace, it's not even clear that it's a call tocombineLatest
that caused the issue, since the only indication I have here is thatcombineLatest.js
appears somewhere in the stacktrace.Expected behavior
I would expect the following code
(without subscription) to throw the following:
Reproduction code
Reproduction URL
https://stackblitz.com/edit/rxjs-gdmq8d?file=index.ts
Version
7.8.0
Environment
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: