Angularfire: Error in complilation ERROR in node_modules/@angular/fire/firebase.app.module.d.ts:2:10 - error TS2614

Created on 27 Oct 2020  路  20Comments  路  Source: angular/angularfire

Hi, Please help me with the folllowing compiling issue:

I have installed :

My project have the following dependencies:

"@angular/animations": "^10.0.14",
"@angular/cdk": "^10.2.2",
"@angular/common": "~10.0.2",
"@angular/compiler": "~10.0.2",
"@angular/core": "~10.0.2",
"@angular/forms": "~10.0.2",
"@angular/material": "^10.2.2",
"@angular/platform-browser": "~10.0.2",
"@angular/platform-browser-dynamic": "~10.0.2",
"@angular/router": "~10.0.2",
"angularfire2": "^5.4.2",
"chart.js": "^2.9.3",
"firebase": "^8.0.0",
"ng2-charts": "^2.4.1",
"ngx-pagination": "^5.0.0",
"rxjs": "~6.5.5",
"sweetalert2": "^9.17.2",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"

Compilation output

ERROR in node_modules/@angular/fire/firebase.app.module.d.ts:2:10 - error TS2614: Module '"../../firebase"' has no exported member 'auth'. Did you mean to use 'import auth from "../../firebase"' instead?

2 import { auth, database, messaging, storage, firestore, functions } from 'firebase/app';
           ~~~~
node_modules/@angular/fire/firebase.app.module.d.ts:2:16 - error TS2614: Module '"../../firebase"' has no exported member 'database'. Did you mean to use 'import database from "../../firebase"' instead?

2 import { auth, database, messaging, storage, firestore, functions } from 'firebase/app';
                 ~~~~~~~~
node_modules/@angular/fire/firebase.app.module.d.ts:2:26 - error TS2614: Module '"../../firebase"' has no exported member 'messaging'. Did you mean to use 'import messaging from "../../firebase"' instead?

2 import { auth, database, messaging, storage, firestore, functions } from 'firebase/app';
                           ~~~~~~~~~
node_modules/@angular/fire/firebase.app.module.d.ts:2:37 - error TS2614: Module '"../../firebase"' has no exported member 'storage'. Did you mean to use 'import storage from "../../firebase"' instead?

2 import { auth, database, messaging, storage, firestore, functions } from 'firebase/app';
                                      ~~~~~~~
node_modules/@angular/fire/firebase.app.module.d.ts:2:46 - error TS2614: Module '"../../firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../firebase"' instead?

2 import { auth, database, messaging, storage, firestore, functions } from 'firebase/app';
                                               ~~~~~~~~~
node_modules/@angular/fire/firebase.app.module.d.ts:2:57 - error TS2614: Module '"../../firebase"' has no exported member 'functions'. Did you mean to use 'import functions from "../../firebase"' instead?

2 import { auth, database, messaging, storage, firestore, functions } from 'firebase/app';
                                                          ~~~~~~~~~
node_modules/@angular/fire/storage/interfaces.d.ts:1:10 - error TS2614: Module '"../../../firebase"' has no exported member 'storage'. Did you mean to use 'import storage from "../../../firebase"' instead?

1 import { storage } from 'firebase/app';
           ~~~~~~~
node_modules/@angular/fire/storage/observable/fromTask.d.ts:3:10 - error TS2614: Module '"../../../../firebase"' has no exported member 'storage'. Did you mean to use 'import storage from "../../../../firebase"' instead?

3 import { storage } from 'firebase/app';
           ~~~~~~~
node_modules/@angular/fire/database/interfaces.d.ts:2:10 - error TS2614: Module '"../../../firebase"' has no exported member 'database'. Did you mean to use 'import database from "../../../firebase"' instead?

2 import { database } from 'firebase/app';
           ~~~~~~~~

image

Most helpful comment

Thanks KingDarBoja is working

People use : npm install [email protected] angularfire2 --save

All 20 comments

Same here!

This is a duplicate of #2619.

Same issue here

Same here

Please use latest version of Firebase v7 instead of v8 as angularfire is not compatible yet. A pull request has been made addressing this update at #2620.

Thanks KingDarBoja is working

People use : npm install [email protected] angularfire2 --save

Thanks KingDarBoja is working

People use : npm install [email protected] angularfire2 --save

@rogerbobbio Protip: angularfire2 is now @angular/fire. :D

Closing in favor of #2619

updated with latest version seem still same

Angular:
10.2.1

Firebase:
8.0.0

AngularFire:
6.0.4

"export 'auth' was not found in 'firebase/app'
"export 'auth' was not found in 'firebase/app'
"export 'firestore' was not found in 'firebase/app'

With the new version, now you need to export firebase/app as follows:

import firebase from 'firebase/app';

  login() {
    this.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider());
  }

I still have the issue with the latest Angular Fire and Firebase.

Angular:
10.2.1

Firebase:
8.0.0

AngularFire:
6.0.4

PFA the screenshot of the error while serving my app:

Screenshot 2020-11-04 at 9 56 45 PM

I still have the issue with the latest Angular Fire and Firebase.

Angular:
10.2.1

Firebase:
8.0.0

AngularFire:
6.0.4

PFA the screenshot of the error while serving my app:

Screenshot 2020-11-04 at 9 56 45 PM

Are you sure that is AngularFire 6.0.4? Seems like 6.0.3 for me.

Did you forget to npm install?

@sarunint Actually I managed to solve the issue I was having. My Node was v15. I downgraded to v14 and everything served fine.

same here

I still have the issue using the 6.04v of the Angular Fire and 7v of Firebase

image

You need to install firebase v8, not v7, take a look at the compatibility table at https://github.com/angular/angularfire#compatibility

Hello peoples please use version 7 instead of 8 use this npm command and it will work i was also shocked when i got this error but thans to @rogerbobbio and @KingDarBoja
npm install [email protected] angularfire2 --save

This is actually the correct install until this is resolved with new @angularfire:

npm install [email protected] @angular/[email protected] --save

Otherwise 6.0.4 is installed by default and that's broken

@JefferE
I used this and it worked fine with ionic 4 and angular 8
npm install [email protected] angularfire2 --save

though it gives some warning but it will solve the issue, try this
npm install [email protected] @angular/[email protected] --save

Was this page helpful?
0 / 5 - 0 ratings