While executing a query from server side, I get this error in the catch
TypeError: Cannot read property 'DEADLINE_EXCEEDED' of undefined\n at /.../server/node_modules/@google-cloud/firestore/build/src/util.js:125:99\n at Array.map (
const r = firestore.collection('acollection');
r
.where('somefield', '=', somevalue)
.where('timestampfield', '>=', unixformattimestamp)
.get().catch()
my timestamp format is maybe incorrect, but the error reported is not appropriate
I cannot reproduce the issue is I remove the second where condition
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
setting a composite index fixes the issue, however the error reported is misleading.
@ad34 Sorry for not looking at this much earlier.
I suspect that you are getting the error because the version of google-gax you are using does not export the Status enum. This was added in v1.13.0 of Google Gax, which this library now depends on. Can you confirm what version of google-gax you have installed?
@schmidt-sebastian thanks, you are right, forcing the dependency to 1.13 like this solved the issue
"resolutions": {
"**/google-gax": "1.13.0"
}
the message is clear now :
9 FAILED_PRECONDITION: The query requires an index. You can create it here: https://console.firebase.google.com/v1/r/project/xxxxx/firestore/indexes?create_comp
I saw this error while trying to run the firebase emulator to test functions. Turns out I had used a mix of yarn and npm to install dependencies. Cleaning out node_modules, removing lock files, and then re-installing with only either yarn or npm helped
Most helpful comment
I saw this error while trying to run the firebase emulator to test functions. Turns out I had used a mix of yarn and npm to install dependencies. Cleaning out
node_modules, removing lock files, and then re-installing with only either yarn or npm helped