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.

Fixed: The required column was not present in the results of a 'FromSql' operation in asp.net core EF core

Severity Code Description Project File Line Suppression State Error Unable to resolve dependencies. 'Xamarin.Android.Support.Design 24.2.1' is not compatible with 'Xamarin.Forms 2.3.3.180 constraint: Xamarin.Android.Support.Design (= 23.3.0)'. 0