TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable

前端 未结 20 1197
时光说笑
时光说笑 2020-12-01 06:22

I am trying to map from a service call but getting an error. Looked at subscribe is not defined in angular 2? and it said that in order to subscribe we need to

20条回答
  •  孤街浪徒
    2020-12-01 06:49

    This error happened to me @angular 7

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

    The error is actually self-explanatory, it says somewhere in the observable I pass the invalid object. In my case, there was lots of API call but all the calls were failing because of wrong server configuration. I tried to use map, switchMap, or other rxjs operator but the operators are getting undefined objects.

    So double-check your rxjs operator inputs.

提交回复
热议问题