添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account Property 'child' in type 'DataSnapshot' is not assignable to the same property in base type 'DataSnapshot'. after updating firebase-admin to v12.0.0 #1513 Property 'child' in type 'DataSnapshot' is not assignable to the same property in base type 'DataSnapshot'. after updating firebase-admin to v12.0.0 #1513 sceee opened this issue Jan 17, 2024 · 5 comments

Related issues

Similar/the same issue as the closed issues #1442 and #1444 and #1496 (comment)

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

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;

Were you able to successfully deploy your functions?

No, as they cannot be built.

baraknaveh, ChrisYohann, juane1000, matt-hall-zory, gregfenton, fanwgwg, and HenningKuehl reacted with thumbs up emoji ksinghal reacted with eyes emoji All reactions "@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
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