angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

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

Open rogerbobbio opened this issue 6 years ago • 28 comments

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

rogerbobbio avatar Oct 27 '20 22:10 rogerbobbio

Same here!

ingrocha avatar Oct 27 '20 22:10 ingrocha

This is a duplicate of #2619.

xylo04 avatar Oct 27 '20 22:10 xylo04

Same issue here

devsandro avatar Oct 28 '20 04:10 devsandro

Same here

Puthxii avatar Oct 28 '20 09:10 Puthxii

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.

KingDarBoja avatar Oct 28 '20 13:10 KingDarBoja

Thanks KingDarBoja is working

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

rogerbobbio avatar Oct 28 '20 13:10 rogerbobbio

Thanks KingDarBoja is working

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

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

sarunint avatar Oct 28 '20 15:10 sarunint

Closing in favor of #2619

jamesdaniels avatar Oct 29 '20 22:10 jamesdaniels

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'

jordankkk avatar Nov 01 '20 02:11 jordankkk

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());
  }

KingDarBoja avatar Nov 01 '20 15:11 KingDarBoja

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

sleepinzombie avatar Nov 04 '20 17:11 sleepinzombie

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 avatar Nov 05 '20 14:11 sarunint

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

sleepinzombie avatar Nov 05 '20 15:11 sleepinzombie

same here

inbatamilan-573 avatar Nov 06 '20 10:11 inbatamilan-573

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

image

gabriel-arrvda avatar Nov 10 '20 01:11 gabriel-arrvda

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

KingDarBoja avatar Nov 10 '20 14:11 KingDarBoja

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

Awais-mohammad avatar Nov 17 '20 05:11 Awais-mohammad

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 avatar Nov 19 '20 19:11 JefferE

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

Awais-mohammad avatar Nov 20 '20 01:11 Awais-mohammad

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

pkmuduli001 avatar Nov 25 '20 10:11 pkmuduli001