Firebase Functions for Firestore Failing due to NanoMatch Issue - function

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

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.

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

Use this:
npm install nanomatch#1.2.9 -S

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

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!)

Related

Error in initiating astro after choosing a framework

I'm trying to initiate astro. When i don't choose a framework i get this error although i have git installed and fully working. Any help will be highly appreciated.
√ Which frameworks would you like to use? »
> Copying project files...
could not find commit hash for latest
This seems to be an issue with degit. Please check if you have 'git' installed on your system, and install it if you don't have (https://git-scm.com).
If you do have 'git' installed, please file a new issue here: https://github.com/withastro/astro/issues
It depends on your OS and environment.
For instance, withastro/astro issue 2144 reports the exact same error message, but on Windows, using Linux on WSL2 (Ubuntu 20.04.3 LTS).
Double-check your %PATH%/$PATH in your execution environment.
Update Oct. 2022, ten month later: withastro/astro issue 2144 is reported closed with the workaround by Matej Bunček:
As I was researching this seems to be a general issue with NPM for those who uses SSH.
There's an open issue here: npm/cli#2610 which is still far from being resolved and it's a huge thread.
Some folks might be interested in these workarounds to get it working.
git config --global url."https://github.com/".insteadOf git#github.com:
git config --global url."https://".insteadOf git://
Also I've tried yarn, npm and pnpm, all of them seems to have same problem so I believe it's core problem of node.
Also both npm 6 and 7 are not working.
Not a direct solution to your error message, but a general solution for those kinds of errors:
I would recommend doing the development inside docker containers, so called devcontainers.
Since you will develop in separate and isolated environments containing only the project's minimum dependencies and tools, it is a lot less likely to face OS specific issues in general.
Here are some resources to get started:
https://code.visualstudio.com/docs/remote/containers
https://microsoft.github.io/code-with-engineering-playbook/developer-experience/devcontainers/
https://github.com/microsoft/vscode-dev-containers

Firebase Cloud Functions - Error: Functions did not deploy properly. - Provided module can't be loaded

today I had the following after running the command firebase functions deploy --only functions.
After much research, I found the command firebase functions:log
This showed me the "correct" error.
Provided module can't be loaded. Did you list all required modules in
the package.json dependencies?
The solution to my specific problems was:
remove node_modules folder
npm install in functions folder
In my case, After a long time of searching, I found the reason to be that I had disabled billing for the project for some time.
It now worked fine after I enabled it in the Google cloud console.
It would have been really helpful if firebase could show any useful error message to suggest the problem. I found this after many trials.

Does the new update of mosaic (1.8.3) not work on mac?

I notice that the mosaic package was updated a few days ago (1.8.3). Since then, I keep getting an error message that mosaic can't load.
> library(mosaic)
Error: package or namespace load failed for ‘mosaic’:
object ‘compare’ is not exported by 'namespace:mosaicCore'
The package installed, and it works on a PC. I've tried reinstalling R and R studio to be sure but I keep getting the same error. Anyone who has had the same problem or figured out how to fix it?
It works fine on a Mac (it was developed on a Mac).
I'm not sure how you did your installation, but you also need to have an updated version of mosaicCore. Looks like that didn't happen for some reason.
I'd suggest updating mosaicData and ggformula as well, if your update method didn't trigger those already. All four packages went to CRAN last week. If it has been awhile, you might do update.packages().
My daughter met the same problem today.
As per the suggestion here, we install the newest mosaicData, and the problem remains.
Then quit Rstudio, restart Rstudio, after running library(mosaic) again, it mentions that several packages are missing,
After installing the missing packages, everything is ok.
I had other people in my class that had the same issue. Similar to the above answer, i had to:
Uninstall/delete the package ggformula
Update the package mosaicCore
Reinstall ggformula
Reinstall mosaic
That is how i was able to resolve the issue.

Latest bower update (0.5.1) broke Polymer on my website

I realized I never updated Polymer since I first installed with Bower, so I ran bower update on my website's project root and it appeared to update fine, with the exception that it was finding two different versions, 0.3.6 and 0.5.1 I believe. I checked the Github releases section for Polymer and saw that 0.5.1 is the latest stable release so when the option occured I hit 0.5.1. Now when I go to my website on my AppEngine dev server I see this:
Uncaught TypeError: object is not a function
On a bunch of Polymer elements, like
core-collapse.html:59
core-selection.html:77
core-selector.html:78
I'm not sure where I went wrong! Is 0.5.1 not the stabls release? I am very new to terminal stuff so am not sure where to go to try to fix this. Any help would be appreciated! Thanks!
edit: I didn't realize I needed to use /webcomponentsjs/webcomponents.js instead of platform.js now. I'll leave this up in case anyone else is confused in the future!

Force Jenkins Subversion plugin to use HEAD revision

I was using Hudson for doing my project builds and now planning to migrate to Jenkins.
The build server time is not in sync with the developer machines, and hence svn update does not work correctly. In Hudson, I was able to set the revision policy to HEAD, whereas its missing in Jenkins.
I searched a bit and saw that a Jira is created for this issue, but did not find a working solution for the problem.
I tried to manually install the Hudson subversion plugin in Jenkins, and the Revision policy option came up, but for some reason it caused an exception while setting the svn authentication info.
If anyone knows a solution to make this change in Jenkins, kindly reply.
Figured out. Append all SVN urls with #HEAD and svn update will happen from HEAD!
The plugin doesn't offer such feature but you might find useful this jira issue. There is a patch in the comments for that purpose. See Issue 1241.