micromatch / nanomatch

Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but without support for extended globs (extglobs), posix brackets or braces, and with complete Bash 4.3 wildcard support: ("*", "**", and "?").
https://github.com/micromatch
MIT License
95 stars 20 forks source link

v1.2.11 breaks micromatch #15

Open gera2ld opened 6 years ago

gera2ld commented 6 years ago

(Thanks for reporting an issue to nanomatch! If you haven't already read the contributor guidelines, Please do that now, then procede to fill out the details below.)

Please describe the minimum necessary steps to reproduce this issue:

$ yarn add micromatch
$ node
> console.log(require('micromatch')(['foo', 'bar', 'qux'], ['f*', 'b*']));

What is happening (but shouldn't):

TypeError: Cannot read property 'prev' of undefined
    at Compiler.<anonymous> (~/node_modules/nanomatch/lib/compilers.js:267:24)

What should be happening instead?

After downgrading nanomatch to v1.2.9, it works as below:

> console.log(require('micromatch')(['foo', 'bar', 'qux'], ['f*', 'b*']));
[ 'foo', 'bar' ]
jonschlinkert commented 6 years ago

thanks for reporting. I reverted the patch, but I'll keep this open until I figure out specifically which thing I did that broke micromatch.

thejollyrogers commented 6 years ago

Also received an error:

TypeError: Cannot read property 'addQmark' of undefined
    at Compiler.<anonymous> (/app/node_modules/nanomatch/lib/compilers.js:92:16)
jonschlinkert commented 6 years ago

I figured it out, it was a bonehead move on my part. Since it's been a couple of months, I completely forgot that the underlying parser was upgraded in nanomatch, but not in micromatch. Since I locally started upgrading the parser in micromatch I didn't see the failures when I tested the nanomatch changes in micromatch.

Sorry for the inconvenience, and thank you for helping me track down the bugs.

thejollyrogers commented 6 years ago

Thanks for the timely update and communication!

jek-bao-choo commented 6 years ago

This issue affected Firebase Cloud Functions https://stackoverflow.com/questions/51055137/firebase-functions-for-firestore-failing-due-to-nanomatch-issue

jonschlinkert commented 6 years ago

Thanks @choopage, I made comments there to re-direct the conversation here.

vijayasri5G4 commented 6 years ago

i deleted the node _modules and reinstall it using the command npm install. and deployed my functions but again i am facing same problem.

jonschlinkert commented 6 years ago

i deleted the node _modules and reinstall it using the command npm install. and deployed my functions but again i am facing same problem.

Then a cached version of nanomatch is probably being used. You might need to delete lockfiles too. Where are the errors happening? Locally? Somewhere else? I'll need more info to help you debug.

vijayasri5G4 commented 6 years ago

where do i found lock files ?

dew0 commented 6 years ago

Same problem here (using Firebase Cloud Functions, reinstall doesn't seem to do anything). Perhaps Google themselves need to reinstall to pick up the fixed version? (it fails on running a cloud function, no problems locally or when deploying cloud functions)

EvgenyAGM commented 6 years ago

It looks like firebase-admin updated itself to broken version and we can't do anything until google updates it :(

jonschlinkert commented 6 years ago

It looks like firebase-admin updated itself to broken version and we can't do anything until google updates it :(

Do you know where we can create an issue about it?

mizutori commented 6 years ago

https://github.com/firebase/firebase-tools/issues/274

In the link above a guy in Firebase says,

The Firebase CLI executes your code locally in order to parse the triggers, so you must have node_modules locally in order to deploy. However, when we pack up the functions directory to upload we ignore node_modules so whether it's there or not will not impact deploy time.

So I guess updating modules on our part doesn't fix the issue, but it is they who needs to update the modules.

wsmlby commented 6 years ago

@jonschlinkert can you comment on the stackoverflow page? the bug is not actually fixed in firebase and your comment is kind of misleading.

dew0 commented 6 years ago

For what it's worth, I deleted lock files as well... still no luck of course... as mizutori mentioned above, the node_modules doesn't get uploaded anyway. Seems it needs to be updated server-side at Google. This is probably going to become a pretty big deal...

boolai commented 6 years ago

I am having the same problem as well. It is happening when I called stripe api create subscriptions then try and update firestore document.

jonschlinkert commented 6 years ago

can you comment on the stackoverflow page? the bug is not actually fixed in firebase and your comment is kind of misleading.

I did, before you made your comment.

dew0 commented 6 years ago

Yes, "Firebase Functions for Firestore Failing due to NanoMatch" isn't actually fixed yet (even though nanomatch might be)...

gkabule commented 6 years ago

i am calling an https cloud function to access firestore from a C# client - and i am getting this response back - TypeError: Cannot read property 'addQmark' of undefined...

Anybody figure out the solution or are waiting on Google to fix (panic!)

mizutori commented 6 years ago

Seems it's working now!

gkabule commented 6 years ago

thanks

On Jun 27, 2018, at 12:33 AM, Takamitsu Mizutori notifications@github.com wrote:

Seems it's working now!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/micromatch/nanomatch/issues/15#issuecomment-400572543, or mute the thread https://github.com/notifications/unsubscribe-auth/AHUQ0ccYPxwspsfAmZA1K4jQLeL5Ld6Lks5uAzVdgaJpZM4U5D4X.

sharanan commented 6 years ago

The issue persists. +1 to problem being at the gcloud's end. Have tried fresh npm install, removing lock files, downgrading firebase-admin, firebase-fn versions. Still no luck. Anyone else other than @mizutori seeing a happy path? Any workaround while Firebase/GCloud responds?

jonschlinkert commented 6 years ago

Earlier, I started getting issues within a few minutes of publishing the broken code, which means it was picked up immediately. Obviously the fact that I unpublished the broken code wasn't picked up.

Maybe if I re-publish the 1.2.9 release (the working, older code) it will be picked up again?

sharanan commented 6 years ago

Gave it another try...its working now! On local:-

roger199585 commented 6 years ago

It seems that v1.2.11 still have the same problem on my cloud functions. Any way can solve this problem? Should I install the v1.2.9?

jonschlinkert commented 6 years ago

Should I install the v1.2.9?

Please read this entire thread.

dew0 commented 6 years ago

I did as sharanan said, and it finally works for me too :)

lukashavrlant commented 6 years ago

Can you maybe release a new version of nanomatch with reverted changes instead of unpublishing the existing modules? We still get the error because the nanomatch@1.2.11 is cached somewhere. I certainly can flush all the caches in the way but I think releasing a new version would be a cleaner way to (temporarily) fix it.

jonschlinkert commented 6 years ago

Can you maybe release a new version of nanomatch with reverted changes instead of unpublishing the existing modules?

I didn't unpublish modules, I rolled back a release. I agree though, I'll publish a new patch in a few min.

edit: done, I re-published 1.2.9 as patch 1.2.13 (the intermediate versions were rolled back). Again, sorry about the issues.

mgroenhoff commented 6 years ago

@jonschlinkert Just for my information. If you did not unpublish it, how did you rolled it back?

es128 commented 6 years ago

@mgroenhoff he unpublished the bad version, not the entire module. Just a semantic issue with the way the question was posed.

DevelopCodeUser commented 2 years ago

Thks u!!!!!!! U've saved me!!

bruceauyeung commented 1 year ago

looks like the problem still exists within version 1.2.13