Skip to content

app-types has a relative dependency on firestore causing compilation failure #2415

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

Closed
jahed opened this issue Dec 6, 2019 · 3 comments · Fixed by #2425
Closed

app-types has a relative dependency on firestore causing compilation failure #2415

jahed opened this issue Dec 6, 2019 · 3 comments · Fixed by #2425
Assignees

Comments

@jahed
Copy link

jahed commented Dec 6, 2019

[REQUIRED] Describe your environment

  • Operating System version: Fedora 31
  • Browser version: n/a
  • Firebase SDK version: [email protected]
  • Firebase Product: app-types
    "@firebase/app": "0.4.26",
    "@firebase/app-types": "0.4.9",
    "@firebase/auth": "0.13.2",
    "@firebase/database": "0.5.14",
    "@firebase/storage": "0.3.21",
    "@firebase/util": "0.2.35",

[REQUIRED] Describe the problem

app-types has a relative dependency on firestore. This causes TypeScript compilation failure if firestore is not installed (as it's not used by the consuming application).

See the following line:
https://github.com/firebase/firebase-js-sdk/blame/master/packages/app-types/private.d.ts#L26

node_modules/@firebase/app-types/private.d.ts(26,26): error TS2307: Cannot find module '../firestore/test/util/promise'.

There may be other issues. This is everything I get when I run tsc with the latest firebase packages:

node_modules/@firebase/app-types/private.d.ts(26,26): error TS2307: Cannot find module '../firestore/test/util/promise'.
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'.
    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'.
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'.
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("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type '(url: string) => import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").Reference'.
    Type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").Reference'.
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'.
    Type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").Reference'.
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("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/DataSnapshot").DataSnapshot | null' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").DataSnapshot | null'.
          Type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/DataSnapshot").DataSnapshot' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").DataSnapshot'.
            Types of property 'ref' are incompatible.
              Type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").Reference'.
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("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").Reference'.
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("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/Reference").Reference | null' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").Reference | null'.
    Type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").Reference'.
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("/{{project_dir_omitted}}/node_modules/@firebase/database/dist/src/api/Reference").Reference' is not assignable to type 'import("/{{project_dir_omitted}}/node_modules/@firebase/database-types/index").Reference'.
node_modules/@firebase/database/dist/src/core/AuthTokenProvider.d.ts(18,42): error TS2307: Cannot find module '@firebase/auth-interop-types'.
node_modules/@firebase/database/dist/src/core/Repo.d.ts(24,42): error TS2307: Cannot find module '@firebase/auth-interop-types'.
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@wilhuff
Copy link
Contributor

wilhuff commented Dec 6, 2019

It looks like this reference was added in #2378. @Feiyang1, could you have a look?

@Feiyang1
Copy link
Member

Feiyang1 commented Dec 9, 2019

Good catch! It will be fixed in #2425

@firebase firebase locked and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants