"You provided undefined were a stream was expected" is extremely hard to debug #6788
Replies: 2 comments 1 reply
-
Yep - I think that would improve it. However, the place where I've had this error happening most of the time is within a switchMap: const myObservable$ = of(1).pipe(
switchMap(v => getObservableForValue(v))
) If Essentially this happens with all high order observables - |
Beta Was this translation helpful? Give feedback.
-
Any other input...? I'd like to implement this but I first want to know of there's an objection / an issue I can't see. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following code:
This code will not fail even if
someObservable$
is undefined, but it WILL fail while trying to subscribe it:That makes it extremely difficult to debug and find where is the place were undefined was provided were a stream was expected. Especially if there's a long change with combineLatests spread across different file, and the subscribe call is in entirely different place.
I feel like a good solution for this is if combineLatest had thrown an error immediately when called with illegal values, so the call-stack will show the exact place the error is in, and will make it easier to debug.
I suspect it's not a problem ONLY with combineLatest, and of course the solution should address all situation were this error could occur.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions