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:
firebase-admin to 5.13.1 and 5.12.0 didn't help@google-cloud/firestore module has the same issuegrpc to 1.14.2 via yarn's resolutions didn't helpconst 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());
});
});
I found a few problems with this issue:
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 馃檶
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 馃槄