Firebase-admin-node: firestore APIs fails with TypeError

Created on 21 Oct 2018  路  4Comments  路  Source: firebase/firebase-admin-node

  • Operating System version: macOS 10.13.4
  • Node version: v9.11.2
  • Firebase SDK version: 6.0.0
  • Firebase Product: firestore

Steps to reproduce:

Hey there 馃憢I've found that any firestore call fails with TypeError: channel.createCall is not a function. Full stack trace:

TypeError: channel.createCall is not a function
    at getCall (<PROJECT>/node_modules/grpc/src/client_interceptors.js:651:22)
    at <PROJECT>/node_modules/grpc/src/client_interceptors.js:1081:16
    at <PROJECT>/node_modules/grpc/src/client_interceptors.js:1381:14
    at _buildChain (<PROJECT>/node_modules/grpc/src/client_interceptors.js:1384:33)
    at Object.getInterceptingCall (<PROJECT>/node_modules/grpc/src/client_interceptors.js:1346:10)
    at ServiceClient.Client.makeBidiStreamRequest (<PROJECT>/node_modules/grpc/src/client.js:673:47)
    at apply (<PROJECT>/node_modules/lodash/lodash.js:478:17)
    at ServiceClient.wrapper (<PROJECT>/node_modules/lodash/lodash.js:5323:16)
    at <PROJECT>/node_modules/@google-cloud/firestore/build/src/v1beta1/firestore_client.js:150:41
    at <PROJECT>/node_modules/google-gax/build/src/streaming.js:186:28

Things I've tried:

  • Other APIs including realtime database works fine
  • Downgrading firebase-admin to 5.13.1 and 5.12.0 didn't help
  • Standalone @google-cloud/firestore module has the same issue
  • Downgrading grpc to 1.14.2 via yarn's resolutions didn't help

Relevant Code:

const firebase = require('firebase-admin');

firebase.initializeApp({
  credential: firebase.credential.cert('/path/to/key.json'),
  databaseURL: 'https://<PROJECT_DATABASE>.firebaseio.com/',
});

firebase.firestore().settings({
  timestampsInSnapshots: true,
});

firebase
  .firestore()
  .collection('whatever')
  .limit(1)
  .onSnapshot(snapshot => {
    snapshot.forEach(doc => {
      console.log(doc.id, '=>', doc.data());
    });
  });

Most helpful comment

Alright, so it might've been an issue with node_modules in my monorepo. Cleaning cache and doing hard re-install fixed it. Sorry for that 馃槄

All 4 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Alright, so it might've been an issue with node_modules in my monorepo. Cleaning cache and doing hard re-install fixed it. Sorry for that 馃槄

Cleaning cache did not help in my case. For me it happens during testing (https://firebase.google.com/docs/functions/unit-testing). Updating firebase-functions to version 2.1.0 fixed it.

Deleting and reinstalling the node_modules did it for me 馃檶

Was this page helpful?
0 / 5 - 0 ratings