Site icon codippa

How to resolve “node_modules/rxjs/Observable” has no exported member ‘Observable’ error in angular

If you are working on an angular application, then you should have used Observable from RxJS library. It might happen that when you start using Observable, you might encounter this error.
Module ‘”<path to angular app>/node_modules/rxjs/Observable”‘ has no exported member ‘Observable’.
This article will guide you through the method to resolve this error.
Solution
Check your imports section where Observable is imported, you should see

import { Observable } from ‘rxjs/Observable’;

Modify the above import to

import { Observable } from ‘rxjs’;

Most probably the error should go away.
Reason
In RxJS 5, Observable was present in the package rxjs/Observable but in RxJS 6, it was moved to the package rxjs.
So, if you are facing this error, then check the version of RxJS in package.json file of your application, it would most likely be 6+.
Thus, in order to resolve this error, you can downgrade to RxJS 5(not recommended) or modify the import as suggested above.
Hit the clap if the article was useful.

Exit mobile version