March 2, 2018

The ‘this’ context of type ‘void’ is not assignable to method’s ‘this’ of type ‘Observable<{}>‘.

If you are experiencing this error – usually something with your RxJS imports is wrong. So you should go through them manually or simply delete all imports from RxJS in the corresponding file and let the IDE generate them again.

Something broken could look like this:

Better working might be:

What is happening?

RxJS switched from monkey patching to the import of pipeable operators (also known as lettable operators).

 

 

toPromise

Another reason might be a falsely used toPromise(). It is no longer available as pipeable operator but is now attached to the observable directly.

Should be:

 

Related Posts

Admin Admin
Developer at thecodecampus </>


Leave a Reply

Add code to your comment in Markdown syntax.
Like this:
`inline example`

```
code block
example
```

Your email address will not be published.