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

Firestore SDK does not play well with different versions of grpc-js installed #1233

Closed
mad-it opened this issue Jun 22, 2020 · 1 comment
Closed
Assignees
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. triage me I really want to be triaged.

Comments

@mad-it
Copy link

mad-it commented Jun 22, 2020

Firestore does not seem to play well with a different version of grpc-js installed. In the reproduction repository added below I installed grpc-js version 1.1.0 and immediately connection to the emulator stops working.

Once you remove the grpc-js and run npm dedupe it start working again.

Environment details

  • OS: Linux
  • Node.js version: 12
  • npm version: 6.14.x
  • @google-cloud/firestore version: 3.8.6

Steps to reproduce

Here is a small repository with a reproduction. Run the latest Firestore emulator on port 4500 or adjust the test to run it on desired port.
https://github.com/mad-it/firestore-bug

The error:

jest --no-cache

 FAIL  src/index.spec.ts
  ✕ should work (115ms)

  ● should work

    TypeError: Channel credentials must be a ChannelCredentials object

      11 |   const ref = firestore.collection("test").doc();
      12 | 
    > 13 |   await ref.create({ foo: "foo" });
         |             ^
      14 | 
      15 |   const read = await ref.get();
      16 | 

      at new ChannelImplementation (node_modules/google-gax/node_modules/@grpc/grpc-js/src/channel.ts:150:13)
      at new Client (node_modules/google-gax/node_modules/@grpc/grpc-js/src/client.ts:146:30)
      at new ServiceClientImpl (node_modules/google-gax/node_modules/@grpc/grpc-js/src/make-client.ts:119:3)
      at GrpcClient.createStub (node_modules/google-gax/src/grpc.ts:290:18)
      Caused by: Error: 
      at WriteBatch.commit (node_modules/@google-cloud/firestore/build/src/write-batch.js:415:23)
      at DocumentReference.create (node_modules/@google-cloud/firestore/build/src/reference.js:283:14)
      at Object.<anonymous> (src/index.spec.ts:13:13)
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Jun 22, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 23, 2020
@schmidt-sebastian
Copy link
Contributor

@mad-it Thanks for providing the repro.

This has already been fixed in the SDK and a release for this will go out today. The fix for this is here: 56355f1#diff-4de362b91cfe3cd8254c447a5a08b316R453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants