Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RXJS6 Upgrade: ErrorObservable has no exported member 'ErrorObservable'

I have upgraded my Angular 5 app to 6.0.1 and RxJs to 6.1.0.

In one of my services, I have the import below:

import { ErrorObservable } from 'rxjs/observable/ErrorObservable';

However, I now get the following error:

Module '"...node_modules/rxjs/observable/ErrorObservable"' has no exported member 'ErrorObservable'.

I have search online for how to import this in rxjs6 or if the name

ErrorObservable 

has changed.

I used this as my guide for the upgrade process:

RxJS 6 Changes - Overview

Does anyone know how to resolve this import?

like image 644
Polajenko Avatar asked May 11 '18 20:05

Polajenko


1 Answers

import { Observable, throwError } from 'rxjs';
// import { ErrorObservable } from 'rxjs/observable/ErrorObservable';

Thank you everyone! The above is the answer with the old line commented out.

Usage:

return throwError('some message');
like image 107
Polajenko Avatar answered Oct 23 '22 16:10

Polajenko