We installed angular firebase with
npm install firebase angularfire2 --save
And this error occured
ERROR in node_modules/angularfire2/firebase.app.module.d.ts(10,22): error TS2420: Class 'FirebaseApp' incorrectly implements interface 'FirebaseApp'.
Property 'automaticDataCollectionEnabled' is missing in type 'FirebaseApp'.
How can I solved it?
I would advise against modifying your node_modules
directly. It is unnecessary and bad practise, as your changes will be overwritten by updates.
Op's error seems to occur when using a combination of the latest [email protected]
and [email protected]
.
Solution:
Some suggest downgrading the firebase
package, but a better option might be installing @firebase/app@^0.1.10
which fixed the errors in my case.
Note:
The latest firebase 4.13.1
introduces some changes to Firestore Timestamp/Date objects, that I had already implemented, and would have to revert if downgrading the firebase
package.
This work for me. Edit firebase.app.module.d.ts file
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 add @firebase/app
npm i -S @firebase/app
EDIT
The problem is solved by installing "angularfire2": "^5.0.0-rc.7"
Just run npm install angularfire2@latest
Try to use these dependencies in package.json
"dependencies": {
"firebase":"4.12.1",
"angularfire2":"^5.0.0-rc.6",
"@firebase/app": "^0.1.10"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With