Firebase Functions for Firestore Failing due to Na

2019-03-18 14:11发布

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

5条回答
▲ chillily
2楼-- · 2019-03-18 14:27

just rollback to older version npm install -g firebase-tools@3.19.0

查看更多
beautiful°
3楼-- · 2019-03-18 14:28

Use this:

npm install nanomatch@1.2.9 -S

查看更多
狗以群分
4楼-- · 2019-03-18 14:33

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.

查看更多
疯言疯语
5楼-- · 2019-03-18 14:40

Firebase team is probably/hopefully redeploying all functions without the broken nanomatch package, but for me following the advice from @abhi and redeploying immediately solved the issue!

npm install nanomatch@1.2.9 -S
firebase deploy --only functions

(npm install in the functions folder!)

查看更多
看我几分像从前
6楼-- · 2019-03-18 14:44

Faced the same problem "Thumbnail URL not saved to firestore. Cannot read property 'addQmark' of undefined" Started today morning when I upgraded to the latest firebase-tools@3.19.1 At first thought was issue with my code, but after rollbacking my code the situation persisted. Rolled back to firebase-tools@3.19.0 and the situation got fixed. There is a bug in the latest firebase-tools

查看更多
登录 后发表回答