Sampath
Sampath

Reputation: 65988

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

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'.

Upvotes: 9

Views: 19989

Answers (8)

azhar
azhar

Reputation: 380

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.

Upvotes: 2

Mwiza
Mwiza

Reputation: 9011

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'

Upvotes: 1

Shalini
Shalini

Reputation: 219

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

Upvotes: 0

Geek
Geek

Reputation: 663

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

Upvotes: -1

T. Shashwat
T. Shashwat

Reputation: 1165

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

Upvotes: 16

RAHULRSANNIDHI
RAHULRSANNIDHI

Reputation: 537

try with this:

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

Upvotes: 5

sudheer nunna
sudheer nunna

Reputation: 1719

npm install @reactivex/rxjs

import * as Rx from 'rxjs';

Upvotes: 0

basarat
basarat

Reputation: 276373

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

Because it doesn't have an exported member named Rx.

More

You cannot import something that isn't exported.

Upvotes: 0

Related Questions