Node_modules/rxjs/Rx"' has no exported member 'Rx'

Viewed 19193

Can you tell me why below behavior with rxjs/Rx? I'm using VS code V 1.14.1.

This works:

import * as Rx from 'rxjs/Rx';

and

import Rx from 'rxjs/Rx';

But This is not working.

import { Rx } from 'rxjs/Rx';

node_modules/rxjs/Rx"' has no exported member 'Rx'.

8 Answers

its rxjs issue , i fixed it using npm install rxjs-compat

try with this:

import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';

Note: Rxjs does not have or export Rx

so, Import {Rx} from 'rxjs' will not work

If you want to import something specific like an Observable, you can do:

import { Observable } from 'rxjs';

Alternatively, you can import entire Rxjs and give it an alias of Rx as follows:

Import * as Rx from 'rxjs'

I had the same issue. I solved the issue by installing npm install rxjs.

Use import * as Rx from "rxjs"; instead of import * as Rx from "rxjs/Rx";. Just remove the Rx after the slash.

npm install @reactivex/rxjs

import * as Rx from 'rxjs';

I had this issue recently. Fixed it using below steps

remove node_modules using rm -rf node_modules/

set rxjs v6.0.0, rxjs-compat v6.0.0 in package.json

run npm install

run ionic serve

I encountered the same issue . This seems to be the problem because they are using version of RxJs which you might not be using.

I will suggest to just downgrade angular flex to 5.0.0-beta.14.

reference : https://github.com/angular/flex-layout/issues/702

Related