Skip to content
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

Fresh firebase init functions TypeScript build fails with type errors #4181

Closed
mcmillion opened this issue Feb 17, 2022 · 2 comments
Closed

Comments

@mcmillion
Copy link

[REQUIRED] Environment info

firebase-tools: 10.2.0

Platform: macOS

[REQUIRED] Test case

Using current latest firebase-tools, a freshly-created TypeScript functions project fails to build with type errors in google-gax.

[REQUIRED] Steps to reproduce

mkdir test-project

cd test-project

firebase init functions

<follow prompts and pick TypeScript>

cd functions

npm run build

[REQUIRED] Expected behavior

The project builds

[REQUIRED] Actual behavior

tsc fails with:

node_modules/google-gax/build/src/clientInterface.d.ts:7:18 - error TS2320: Interface 'ClientOptions' cannot simultaneously extend types 'GrpcClientOptions' and 'GoogleAuthOptions'.
  Named property 'auth' of types 'GrpcClientOptions' and 'GoogleAuthOptions' are not identical.

7 export interface ClientOptions extends GrpcClientOptions, GoogleAuthOptions, ClientStubOptions {
                   ~~~~~~~~~~~~~

node_modules/google-gax/build/src/grpc.d.ts:24:18 - error TS2430: Interface 'GrpcClientOptions' incorrectly extends interface 'GoogleAuthOptions'.
  Types of property 'auth' are incompatible.
    Type 'GoogleAuth | undefined' is not assignable to type 'AuthClient | undefined'.
      Type 'GoogleAuth' is missing the following properties from type 'AuthClient': on, credentials, eagerRefreshThresholdMillis, forceRefreshOnFailure, and 16 more.

24 export interface GrpcClientOptions extends GoogleAuthOptions {
                    ~~~~~~~~~~~~~~~~~

src/index.ts:1:1 - error TS6133: 'functions' is declared but its value is never read.

1 import * as functions from "firebase-functions";
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 3 errors.

The last error is expected, given that this is a fresh empty project, but I can't seem to fix the first two. Seems like this may be an upstream issue with whatever version of google-gax is getting pulled, but I see nothing in their repo about it.

@mcmillion mcmillion added the bug label Feb 17, 2022
@dimavedenyapin
Copy link

The same error started happening 9 hours ago in my project that doesn't use firebase at all.

we use these packages

		"@google-cloud/bigquery": "^5.9.3",
		"@google-cloud/firestore": "5.0.1",
		"@google-cloud/functions-framework": "2.1.0",
		"@google-cloud/pubsub": "^2.12.0",
		"@google-cloud/secret-manager": "3.10.1",
		"@google-cloud/storage": "^5.16.1",

Issue happens on build

@taeold
Copy link
Contributor

taeold commented Feb 22, 2022

@dimavedenyapin Thanks for sharing!

It looks like the upstream issue has been fixed. I confirmed locally that a newly initialized TS functions project don't have tsc issue described in the OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants