angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

TypeScript 2.4.2 compile error

Open colinskow opened this issue 9 years ago • 4 comments

I am getting a TypeScript error compiling [email protected] with [email protected], using Angular 5.0.1. A very similar error also pops up when I tried TS 2.5.3.

ERROR in node_modules/angularfire2/firebase.app.module.d.ts(5,22): error TS2420: Class 'FirebaseApp' incorrectly implements interface 'App'.
  Property 'firestore' is missing in type 'FirebaseApp'.
node_modules/angularfire2/firebase.app.module.d.ts(12,28): error TS2694: Namespace 'firebase' has no exported member 'Promise'.

colinskow avatar Nov 09 '17 22:11 colinskow

I jerry-patched firebase.app.module.d.ts to work:

export declare class FirebaseApp implements firebase.app.App {
    name: string;
    options: {};
    auth: () => firebase.auth.Auth;
    database: () => firebase.database.Database;
    messaging: () => firebase.messaging.Messaging;
    storage: () => firebase.storage.Storage;
    delete: () => Promise<any>;
    firestore(): firebase.firestore.Firestore;
}

colinskow avatar Nov 09 '17 22:11 colinskow

Hey @colinskow! You need to make sure you're on AngularFire 5.0.0-rc.3 and Firebase ^4.6.0. That should resolve it!

davideast avatar Nov 10 '17 12:11 davideast

@davideast thanks for the response. I had the dependency set to "angularfire2": "^5.0.0-rc.3". Apparently yarn was installing RC.0-next. Using an exact version 5.0.0-rc.3 resolved the issue.

colinskow avatar Nov 10 '17 18:11 colinskow

hi, i m currently using angularfire2 : ^4.0.0-rc.2 and it gives me the same error, which version should I use for the firebase. I have to use angularfire2 : ^4.0.0-rc.2 this version only... thanx...

noor07 avatar Mar 23 '18 18:03 noor07