find and solve || findandsolve.com
Please wait.....

Has no Exported Member Observable - import { Observable } from rxjs/Observable


src/app/components/artical/artical-services/artical-services-component.ts:4:10 - error TS2305: Module '"E:/Running Project/Artical_V0/artical/artical/ClientApp/node_modules/rxjs/Observable"' has no exported member 'Observable'.4 import { Observable } from 'rxjs/Observable';


Answer



Option 1.

You need to import like as given below

import { Observable } from 'rxjs';

This is most likely due to the fact that you updated your angular project or library rxjs.


Option 2.

According to the error, it clearly says that Cannot find module 'rxjs-compat/Observable' in order to use it rxjs-compat/Observable, you need to install it inside your project. To install

npm install --save rxjs-compat


Option 3.

rxjs: Creation methods, types, schedulers and utilities

import { Observable, Subject, asapScheduler, pipe, of, from, interval, merge, fromEvent } from 'rxjs';

rxjs/operators: All pipeable operators:

import { map, filter, scan } from 'rxjs/operators';

rxjs/ajax: The Rx ajax implementation

import { ajax } from 'rxjs/ajax';


Option 4.

Change rxjs version and then update like as given below

npm update

or 

npm install rxjs-compat --save


Option 5.

yout just remove /Observable from 'rxjs/Observable';

If you then get Cannot find module 'rxjs-compat/Observable' just put below line to thr terminal and press enter.

npm install --save rxjs-compat


Mahira  khanna

Mahira khanna

I have the skills you need for you company blog, website, or other content materials

Comments



Report Response