lmcq / firebase-firestorm

Firebase Firestorm is an ORM for Firestore which can be used with Typescript.
MIT License
252 stars 19 forks source link

Type 'Firestore' is missing the following properties from type 'Firestore': enablePersistence, app, clearPersistence, enableNetwork, and 3 more. #26

Open feliperoschel opened 4 years ago

feliperoschel commented 4 years ago

Hi, I'm getting this error trying to initialize the app:

error TS2345: Argument of type 'FirebaseFirestore.Firestore' is not assignable to parameter of type 'firebase.firestore.Firestore'.
  Type 'Firestore' is missing the following properties from type 'Firestore': enablePersistence, app, clearPersistence, enableNetwork, and 3 more.

19 export default firestorm.initialize(_app_);

Any clue? Here's my entire code:

import firebase from 'firebase-admin';
import * as firestorm from 'firebase-firestorm';
import serviceAccount from '../config/firebase.json';

const params = {
  type: serviceAccount.type,
...
  clientC509CertUrl: serviceAccount.client_x509_cert_url,
};

const app = firebase.initializeApp(params).firestore();
export default firestorm.initialize(app);

image

Thanks

DominicCabral commented 4 years ago

I understand that the example is assuming the developer will be using the client SDK "firebase/app" rather than the "firebase-admin".

I am able to initialize when using the client SDK, but I'd like to be able to used the admin SDK similiar to @feliperoschel

DominicCabral commented 4 years ago

Any luck @feliperoschel?

feliperoschel commented 4 years ago

Unfortunately not, I ended up using fireorm instead, that one works with the admin sdk and is typescript oriented which is exactly the project I'm working on so handy.