RXJS6 Upgrade: ErrorObservable has no exported member 'ErrorObservable'

Apol picture Apol · May 11, 2018 · Viewed 7.4k times · Source

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?

Answer

Apol picture Apol · May 11, 2018
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');