12
votes

I am Getting below Error in Auth.d.ts file in Node_Modules Package.

[ts] Module 'node_modules/rxjs/Observable"' has no exported member 'Observable'. import Observable

Find the below code for Auth.d.ts file :

import * as firebase from 'firebase/app';
import 'firebase/auth';

import { Observable } from 'rxjs/Observable';
import { FirebaseApp } from '../app/index';
export declare class AngularFireAuth {
    app: FirebaseApp;
    auth: firebase.auth.Auth;
    authState: Observable<firebase.User>;
    idToken: Observable<firebase.User>;
    constructor(app: FirebaseApp);
}
export declare function FirebaseAuthStateObservable(app: FirebaseApp): Observable<firebase.User>;
export declare function FirebaseIdTokenObservable(app: FirebaseApp): Observable<firebase.User>;

I installed "npm install @reactivex/rxjs" this package also even then I am getting above error

7
I am getting the same error after I upgraded to angular 6 from angular 5. Did you upgrade rxjs? - Arman Fatahi
Yup I updated RXJS - sundeep

7 Answers

22
votes

Try changing it to:

import { Observable } from 'rxjs';
12
votes

Try npm install rxjs-compat or yarn add rxjs-compat.

It's works for me.

5
votes

If you are using angular version 6 then You can use

// creation and utility methods

import { Observable, Subject, pipe } from 'rxjs';

// operators all come from rxjs/operators

import { map, takeUntil, tap } from 'rxjs/operators';
0
votes

You have to downgrade 'rxjs' to use the current 'firebase' package.

The imports changed in new versions of 'rxjs', and firebase is compatible only with version 5.x.x of RxJs for now.

Change your package.json file to use a compatible version of rxjs:

"rxjs": "5.6.0-forward-compat.4"

and re-run npm install:

npm i

0
votes

npm i rxjs-compat

Please add these in root folder

surely your issue will be resolve

0
votes
import { Observable } from 'rxjs';

and install

npm i rxjs-compat
0
votes

if your angular version is 6 and above.

use below:

import { take, map } from "rxjs/operators";

import { timer } from "rxjs/observable/timer";

Install - npm install --save rxjs-compat

Also user pipe with other funtions(Take,Map).

timer(0, 10) .pipe(take(1000)) .pipe(map(() => x));