Reputation: 65988
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
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
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
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
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
Reputation: 537
try with this:
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
Upvotes: 5
Reputation: 276373
node_modules/rxjs/Rx"' has no exported member 'Rx'.
Because it doesn't have an exported member named Rx
.
You cannot import
something that isn't export
ed.
Upvotes: 0