angularfire: automaticDataCollectionEnabled' is missing in type 'FirebaseApp'
Version info
Angular: 5.2.9
Firebase: ^4.13.0
AngularFire2: ^5.0.0-rc.6.0
**Other (e.g. Ionic/Cordova, Node, browser, operating system)š*Ionic/Cordova
How to reproduce these conditions
package.json
"dependencies": {
    "@angular/common": "5.2.9",
    "@angular/compiler": "5.2.9",
    "@angular/compiler-cli": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/platform-browser": "5.2.9",
    "@angular/platform-browser-dynamic": "5.2.9",
    "@ionic-native/core": "4.7.0",
    "@ionic-native/splash-screen": "4.7.0",
    "@ionic-native/status-bar": "4.7.0",
    "@ionic/pro": "1.0.20",
    "@ionic/storage": "2.1.3",
    "angularfire2": "^5.0.0-rc.6.0",
    "firebase": "^4.13.0",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "promise-polyfill": "^7.1.2",
    "rxjs": "5.5.8",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.9",
    "typescript": "~2.6.2"
  }
Debug output
Errors in the JavaScript console
typescript: node_modules/angularfire2/firebase.app.module.d.ts, line: 10 
            Class 'FirebaseApp' incorrectly implements interface 'FirebaseApp'. Property 
            'automaticDataCollectionEnabled' is missing in type 'FirebaseApp'. 
       L9:  export declare const FirebaseAppConfigToken: InjectionToken;
      L10:  export declare class FirebaseApp implements FBApp {
      L11:      name: string;
Expected behavior
Ionic compile would complete with any errors
Actual behavior
Because automaticDataCollectionEnabled is missing in type āFirebaseAppā, error occurs.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 22 (2 by maintainers)
Same issue solved as suggested above⦠At first, I had :
Then after visiting here I did :
npm uninstall firebasenpm cache clean --forcenpm install firebase@4.12.1As a result, it all works well for me. I got :
I have installed
"@firebase/app": "^0.1.10"and itās workingSimple 1-line patch for lazy people like š
sed -i.bak 's|^}$| automaticDataCollectionEnabled: false;}|' node_modules/angularfire2/firebase.app.module.d.tsThis issue is related to latest firebase update https://github.com/firebase/firebase-js-sdk/commit/7c1aa4470c0f5474b11fe57ada4edff65ed90adc
Temporary solution is to set version of firebase in your projects package.json to 4.12.1
export declare class FirebaseApp implements FBApp { name: string; options: {}; automaticDataCollectionEnabled: boolean; // this is the missing line auth: () => FirebaseAuth; database: () => FirebaseDatabase; messaging: () => FirebaseMessaging; storage: () => FirebaseStorage; delete: () => Promise<any>; firestore: () => FirebaseFirestore;} also: npm i -S @firebase/app source: https://stackoverflow.com/a/49968060/9692516
It worked for me, but with ānpm cache cleanā before installing
@Tamango92 actually I was using
firebase 4.12.1. So it didnāt work for me. But I would solve this issue @zverbeta 's solution. Thank you. #1572 and I sent PR about this.It is worked for @cicode225 ,Thanks a lot Same issue solved as suggested above⦠At first, I had :
ādependenciesā: { āfirebaseā:ā^4.13.1ā, āangularfire2ā:ā^5.0.0-rc.6ā } Then after visiting here I did :
npm uninstall firebase npm clean cache --force npm install firebase@4.12.1 As a result, it all works well for me. I got :
ādependenciesā: { āfirebaseā:ā^4.12.1ā, āangularfire2ā:ā^5.0.0-rc.6ā }