All calls to firestore via firebase-admin sdk fail with the following reason:-
TypeError: Cannot read property 'addQmark' of undefined
at Object.
at Object.visit (/user_code/node_modules/firebase-admin/node_modules/snapdragon/lib/compiler.js:129:15)
at Object.mapVisit (/user_code/node_modules/firebase-admin/node_modules/snapdragon/lib/compiler.js:143:12)
at Object.compile (/user_code/node_modules/firebase-admin/node_modules/snapdragon/lib/compiler.js:168:10)
at Snapdragon.compile (/user_code/node_modules/firebase-admin/node_modules/snapdragon/index.js:156:32)
at /user_code/node_modules/firebase-admin/node_modules/micromatch/index.js:786:23
at memoize (/user_code/node_modules/firebase-admin/node_modules/micromatch/index.js:859:13)
at Function.micromatch.compile (/user_code/node_modules/firebase-admin/node_modules/micromatch/index.js:783:10)
at create (/user_code/node_modules/firebase-admin/node_modules/micromatch/index.js:686:25)
at /user_code/node_modules/firebase-admin/node_modules/micromatch/index.js:695:16
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
It appears that firebase-admin is using a buggy version of nanomatch that was reverted right after the issue was created.
Please see https://github.com/micromatch/nanomatch/issues/15 for more details.
Is it fixed?
I can not facing this error when re-deploy my function to Firebase.
Please see micromatch/nanomatch#15 for updates.
Looks like Firebase guys fixed their node_modules. It's working now for me. Any confirmations before I close?
I still have the same bug after I delete package-lock and node_modules, and then reinstall the npm modules. What is the version of firebase-admin firebase-functions of your project?
Firebase Functions version: 1.1.0
Firebase Admin version: 5.12.1
Still left with the same bug. Updated everything to the versions @sharanan mentioned.
Pretty frustrating tbh
If it is indeed the same issue, it鈥檚 resolved by simply reinstalling dependencies.
Most helpful comment
It appears that firebase-admin is using a buggy version of nanomatch that was reverted right after the issue was created.
Please see https://github.com/micromatch/nanomatch/issues/15 for more details.