Skip to content

Fix the compiling errors for firebase-admin #2447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

Merged
merged 2 commits into from
Dec 17, 2019

Conversation

Feiyang1
Copy link
Member

The typing changes made in #2378 broke firebase-admin compilation which uses strict mode which is not enabled for database.

@schmidt-sebastian
Copy link
Contributor

Do you have an error message from the current build?

@hiranya911
Copy link
Contributor

@schmidt-sebastian something like this:

/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Database.d.ts(56,5): error TS2416: Property 'ref' in type 'Database' is not assignable to the same property in base type 'FirebaseDatabase'.
  Type '{ (path?: string | undefined): Reference; (path?: Reference | undefined): Reference; }' is not assignable to type '(path?: string | Reference | undefined) => Reference'.
    Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").Reference'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Database.d.ts(57,5): error TS2416: Property 'ref' in type 'Database' is not assignable to the same property in base type 'FirebaseDatabase'.
  Type '{ (path?: string | undefined): Reference; (path?: Reference | undefined): Reference; }' is not assignable to type '(path?: string | Reference | undefined) => Reference'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Database.d.ts(65,5): error TS2416: Property 'refFromURL' in type 'Database' is not assignable to the same property in base type 'FirebaseDatabase'.
  Type '(url: string) => import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type '(url: string) => import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").Reference'.
    Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").Reference'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference.d.ts(49,5): error TS2416: Property 'child' in type 'Reference' is not assignable to the same property in base type 'Reference'.
  Type '(pathString: string | Path) => Reference' is not assignable to type '(path: string) => Reference'.
    Call signature return types 'Reference' and 'Reference' are incompatible.
      The types of 'endAt(...).isEqual' are incompatible between these types.
        Type '(other: Query) => boolean' is not assignable to type '(other: Query | null) => boolean'.
          Types of parameters 'other' and 'other' are incompatible.
            Type 'Query | null' is not assignable to type 'Query'.
              Type 'null' is not assignable to type 'Query'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference.d.ts(86,5): error TS2416: Property 'transaction' in type 'Reference' is not assignable to the same property in base type 'Reference'.
  Type '(transactionUpdate: (a: any) => any, onComplete?: ((a: Error | null, b: boolean, c: DataSnapshot | null) => void) | undefined, applyLocally?: boolean | undefined) => Promise<...>' is not assignable to type '(transactionUpdate: (a: any) => any, onComplete?: ((a: Error | null, b: boolean, c: DataSnapshot | null) => any) | undefined, applyLocally?: boolean | undefined) => Promise<...>'.
    Types of parameters 'onComplete' and 'onComplete' are incompatible.
      Types of parameters 'c' and 'c' are incompatible.
        Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/DataSnapshot").DataSnapshot | null' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").DataSnapshot | null'.
          Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/DataSnapshot").DataSnapshot' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").DataSnapshot'.
            Types of property 'ref' are incompatible.
              Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").Reference'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference.d.ts(98,5): error TS2416: Property 'push' in type 'Reference' is not assignable to the same property in base type 'Reference'.
  Type '(value?: any, onComplete?: ((a: Error | null) => void) | undefined) => Reference' is not assignable to type '(value?: any, onComplete?: ((a: Error | null) => any) | undefined) => Reference'.
    Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").Reference'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference.d.ts(105,9): error TS2416: Property 'parent' in type 'Reference' is not assignable to the same property in base type 'Reference'.
  Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference").Reference | null' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").Reference | null'.
    Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").Reference'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference.d.ts(106,9): error TS2416: Property 'root' in type 'Reference' is not assignable to the same property in base type 'Reference'.
  Type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database-types/index").Reference'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/core/AuthTokenProvider.d.ts(18,42): error TS2307: Cannot find module '@firebase/auth-interop-types'.
/usr/local/google/home/hkj/Projects/firebase-admin-node/public/node_modules/@firebase/database/dist/src/core/Repo.d.ts(24,42): error TS2307: Cannot find module '@firebase/auth-interop-types'.

@Feiyang1 Feiyang1 force-pushed the fei-database-type-admin-fix branch from 433325a to 81d4025 Compare December 16, 2019 21:49
Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hiranya911 hiranya911 removed their assignment Dec 17, 2019
@Feiyang1 Feiyang1 merged commit 31b0e52 into master Dec 17, 2019
@Feiyang1 Feiyang1 deleted the fei-database-type-admin-fix branch December 17, 2019 22:05
@Feiyang1
Copy link
Member Author

@schmidt-sebastian Merging to unblock admin. Let me know if you have any feedback, I will address them in a separate PR.

Copy link
Contributor

@schmidt-sebastian schmidt-sebastian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No follow up needed :)

@hsubox76 hsubox76 added this to the 7.6.1 milestone Jan 7, 2020
@firebase firebase locked and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants