nestjs-firebase-admin
nestjs-firebase-admin copied to clipboard
Firebase Admin Version Update
The Firebase Admin SDK is a bit outdated, any chance we can get that bumped up along with the latest version of any other package that needs it?
Running nom outdated
is returning all of these
Package Current Wanted Latest Location Depended by
@nestjs/cli 7.6.0 7.6.0 8.2.1 node_modules/@nestjs/cli nestjs-firebase-admin
@nestjs/schematics 7.3.1 7.3.1 8.0.7 node_modules/@nestjs/schematics nestjs-firebase-admin
@nestjs/testing 7.6.18 7.6.18 8.3.1 node_modules/@nestjs/testing nestjs-firebase-admin
@types/jest 26.0.24 26.0.24 27.4.1 node_modules/@types/jest nestjs-firebase-admin
@types/node 14.18.12 14.18.12 17.0.21 node_modules/@types/node nestjs-firebase-admin
@typescript-eslint/eslint-plugin 4.33.0 4.33.0 5.12.1 node_modules/@typescript-eslint/eslint-plugin nestjs-firebase-admin
@typescript-eslint/parser 4.33.0 4.33.0 5.12.1 node_modules/@typescript-eslint/parser nestjs-firebase-admin
eslint 7.32.0 7.32.0 8.9.0 node_modules/eslint nestjs-firebase-admin
eslint-plugin-prettier 3.4.1 3.4.1 4.0.0 node_modules/eslint-plugin-prettier nestjs-firebase-admin
firebase-admin 9.12.0 9.12.0 10.0.2 node_modules/firebase-admin nestjs-firebase-admin
jest 26.6.3 26.6.3 27.5.1 node_modules/jest nestjs-firebase-admin
ts-jest 26.5.6 26.5.6 27.1.3 node_modules/ts-jest nestjs-firebase-admin
ts-loader 8.3.0 8.3.0 9.2.6 node_modules/ts-loader nestjs-firebase-admin
ts-node 9.1.1 9.1.1 10.5.0 node_modules/ts-node nestjs-firebase-admin
+1
I was trying to instantiate a Firestore instance (using firebase-admin@^10.0.2
vs the firebase-admin@^9.6.0
from this package) and it seems using credentials.cert(..)
isn't evaluating this instanceof
check to true:
https://github.com/firebase/firebase-admin-node/blob/master/src/firestore/firestore-internal.ts#L62
And then subsequently the error from Firestore:
'Failed to initialize Google Cloud Firestore client with the available credentials. Must initialize the SDK with a certificate credential or application default credentials to use Cloud Firestore API.'
...
at getFirestoreOptions (xxx/node_modules/@tfarras/nestjs-firebase-admin/node_modules/firebase-admin/lib/firestore/firestore-internal.js:82:11
But downgrading my firebase-admin
to the same as this package fixes this.
Because this lib will install its own firebase-admin package (v9). To avoid it, add to your package.json
"resolutions": {
"firebase-admin": "^11.3.0"
},