Solvedangularfire automaticDataCollectionEnabled' is missing in type 'FirebaseApp'
✔️Accepted Answer
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 cache clean --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"
}
Other Answers:
I have installed "@firebase/app": "^0.1.10"
and it's working
Simple 1-line patch for lazy people like
sed -i.bak 's|^}$| automaticDataCollectionEnabled: false;}|' node_modules/angularfire2/firebase.app.module.d.ts
This 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
"dependencies": {
"firebase":"4.12.1",
"angularfire2":"^5.0.0-rc.6"
}
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;
firestore: () => FirebaseFirestore;}
also: npm i -S @firebase/app
source: https://stackoverflow.com/a/49968060/9692516
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
Debug output
Errors in the JavaScript console
Expected behavior
Ionic compile would complete with any errors
Actual behavior
Because
automaticDataCollectionEnabled
is missing in type 'FirebaseApp', error occurs.