Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Functions for Firestore Failing due to NanoMatch Issue

I am new to cloud functions and was testing this sample code https://github.com/firebase/functions-samples/tree/master/quickstarts/uppercase-firestore This fails to execute due to an error from nanomatch. Looking at nanomatch repository on GitHub This is a listed issue and reverting back to 1.2.9 takes care of this error.

I am trying to fix this on my end - but how do I do this? Can somebody guide me on this. Thank you for the help.

TypeError: Cannot read property 'addQmark' of undefined
    at Object.<anonymous> (/user_code/node_modules/firebase-admin/node_modules/nanomatch/lib/compilers.js:92:15)
    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
like image 481
Praful Halakhandi Avatar asked Jun 27 '18 05:06

Praful Halakhandi


1 Answers

THIS BUG WAS FIXED

The version that caused the bug was reverted right when this issue was reported on GitHub, which was within minutes of it being released. To get the fix, just reinstall. You might need to delete node_modules and/or lockfiles first, to ensure cached versions aren't used by NPM. This conversation belongs on GitHub, so that we can respond to user feedback. I found this by chance. StackOverflow is not for support).

Edit 2: it appears that firebase-admin itself needs to re-install dependencies as well. I'm looking into how to make that happen.

Please report and check issues on GitHub, where the codebase is and where this discussion belongs.

Visit https://github.com/micromatch/nanomatch/issues/15 for more info.

like image 178
jonschlinkert Avatar answered Sep 22 '22 21:09

jonschlinkert