Property 'catch' does not exist on type 'Observable' in angular 6/7/8/9 Fixed

Error - Property 'catch' does not exist on type 'Observable<any>' in Angular.

Root Cause - When you upgrade your angular application from Angular 2 or Angular 4 to Angular 6 or greater versions then you can face this error. 

As From Angular 5 onwards there were many changes in rxjs. I

Solution - To fix this error change your import syntax as below. change 'catch' to 'catchError'.

import { Observable } from 'rxjs';
import { catchError, map } from 'rxjs/operators';

Thanks


Comments

Popular posts from this blog

Swagger for Azure functions: Undocumented TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body. Fixed.

System.Net.Http.HttpClient' does not contain a definition for 'PostAsJsonAsync

A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance