Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.2.11 breaks micromatch #15

Open
gera2ld opened this issue Jun 27, 2018 · 33 comments
Open

v1.2.11 breaks micromatch #15

gera2ld opened this issue Jun 27, 2018 · 33 comments

Comments

@gera2ld
Copy link

gera2ld commented Jun 27, 2018

(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
Copy link
Member

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
Copy link

Also received an error:

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

@jonschlinkert
Copy link
Member

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
Copy link

Thanks for the timely update and communication!

@jek-bao-choo
Copy link

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

@jonschlinkert
Copy link
Member

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

@vijayasri5G4
Copy link

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
Copy link
Member

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
Copy link

where do i found lock files ?

@dew0
Copy link

dew0 commented Jun 27, 2018

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
Copy link

EvgenyAGM commented Jun 27, 2018

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

@jonschlinkert
Copy link
Member

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
Copy link

firebase/firebase-tools#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
Copy link

wsmlby commented Jun 27, 2018

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

@dew0
Copy link

dew0 commented Jun 27, 2018

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
Copy link

boolai commented Jun 27, 2018

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
Copy link
Member

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
Copy link

dew0 commented Jun 27, 2018

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

@gkabule
Copy link

gkabule commented Jun 27, 2018

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
Copy link

Seems it's working now!

@gkabule
Copy link

gkabule commented Jun 27, 2018 via email

@sharanan
Copy link

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
Copy link
Member

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
Copy link

sharanan commented Jun 27, 2018

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

  • Remove node_modules, package-lock.json
  • Deploy function

@roger199585
Copy link

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
Copy link
Member

Should I install the v1.2.9?

Please read this entire thread.

@dew0
Copy link

dew0 commented Jun 27, 2018

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

@lukashavrlant
Copy link

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 [email protected] 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
Copy link
Member

jonschlinkert commented Jun 27, 2018

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
Copy link

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

@es128
Copy link
Member

es128 commented Jun 28, 2018

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

@DevelopCodeUser
Copy link

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

@bruceauyeung
Copy link

looks like the problem still exists within version 1.2.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests