Closed sceee closed 4 months ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
This seems like a regression that needs a hot fix ASAP. Can't use any of the aggregation since this forces you to downgrade the admin sdk version.
I am getting this error right now with:
"dependencies": {
"@faker-js/faker": "^8.4.0",
"@types/google-libphonenumber": "^7.4.30",
"@types/nodemailer": "^6.4.14",
"axios": "^1.6.7",
"firebase-admin": "^12.0.0",
"firebase-functions": "^4.6.0",
"fp-ts": "^2.16.2",
"google-libphonenumber": "^3.2.34",
"meilisearch": "^0.37.0",
"nodemailer": "^6.9.8",
"urlcat": "^3.1.0",
"uuid": "^9.0.1"
},
The error I get is:
npm run build
> build
> tsc
node_modules/firebase-functions/lib/common/providers/database.d.ts:80:5 - error TS2416: Property 'child' in type 'DataSnapshot' is not assignable to the same property in base type 'DataSnapshot'.
Type '(childPath: string) => DataSnapshot' is not assignable to type '(path: string) => DataSnapshot'.
Call signature return types 'DataSnapshot' and 'DataSnapshot' are incompatible.
The types of 'forEach' are incompatible between these types.
Type '(action: (a: DataSnapshot) => boolean | void) => boolean' is not assignable to type '(action: (a: IteratedDataSnapshot) => boolean | void) => boolean'.
Types of parameters 'action' and 'action' are incompatible.
Types of parameters 'a' and 'a' are incompatible.
Type 'DataSnapshot' is not assignable to type 'IteratedDataSnapshot'.
Types of property 'key' are incompatible.
Type 'string | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.
80 child(childPath: string): DataSnapshot;
~~~~~
node_modules/firebase-functions/lib/common/providers/database.d.ts:100:5 - error TS2416: Property 'forEach' in type 'DataSnapshot' is not assignable to the same property in base type 'DataSnapshot'.
Type '(action: (a: DataSnapshot) => boolean | void) => boolean' is not assignable to type '(action: (a: IteratedDataSnapshot) => boolean | void) => boolean'.
100 forEach(action: (a: DataSnapshot) => boolean | void): boolean;
~~~~~~~
Found 2 errors in the same file, starting at: node_modules/firebase-functions/lib/common/providers/database.d.ts:80
same error here firebase-admin 12.0.0 and firebase-function 4.6.0 are somewhat incompatible
This is fixed in https://github.com/firebase/firebase-functions/pull/1517. I will close this issue for the same reason
Related issues
Similar/the same issue as the closed issues #1442 and #1444 and https://github.com/firebase/firebase-functions/issues/1496#issuecomment-1876963016
I am just reopening this so it gets attention as the comments in the closed issues might be overlooked.
[REQUIRED] Version info
node: v18.18.0
firebase-functions: 4.6.0
firebase-tools: 13.0.3
firebase-admin: 12.0.0
[REQUIRED] Test case
Occurs during build.
[REQUIRED] Steps to reproduce
Build.
[REQUIRED] Expected behavior
No typescript compile error.
[REQUIRED] Actual behavior
Were you able to successfully deploy your functions?
No, as they cannot be built.