-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Unknown argument: uglify #4820
Comments
Hmmm I tested it locally without this problem. Wonder why I'm not seeing a problem. |
I just reproduced on another PC (both are Windows machines if that matters). |
Hmmm well, I guess we should rename it then. camelCase on command line args offends some aesthetic sense of mine. How about instead we do |
Weird this only shows up on windows. /cc @tsriram |
I think the way to handle this is to specify |
Yeah, I think |
Well, even if I change it to |
I actually think that |
I disabled the boolean negation feature of yargs in #3755 when I work on the no-color flag. It's strange that this problem happened. |
What's weird also is it only seems to happen on windows — I can't reproduce the problem on my mac. |
Same on linux. I can't reproduce it. The boolean negation is disabled in the package.json. It's possible to disable it at the creation of the parser. https://github.com/yargs/yargs-parser#configuration. |
Hmm why don't we tackle the actual problem then — @borekb could you file an issue with yargs to try to figure out why |
Agree that if it's indeed an upstream bug, it should be reported there. However, I'm not sure it is (feels quite weird that string parsing should be OS-dependent). I need to find some time to build a repro for the |
@KyleAMathews I'm stuck at step four ( |
I cannot get the dev setup working on my Windows machine, are there any Gatsby devs on Windows who could advise? Or is there a better place (chat?) to ask? But I can say that |
One difference is that gatsby/packages/gatsby-cli/src/create-cli.js Line 201 in d169097
gatsby/packages/gatsby-cli/src/create-cli.js Line 127 in d169097
|
I tried this on windows and |
Not sure if this could be the problem but try these commands:
maybe one of these packages is not up to date |
Oh I just realized something – thanks, @pieh! An important detail in the OP, and also my miscommunication (sorry!) is that I'm actually running
Note how |
How do I tell in which version (and of which packages) shipped a particular PR? I'd like to check in which versions of |
(I've updated the OP to specifically mention the local Gatsby dependency.) |
@borekb you can check merge commit and see tags on github - it was added in [email protected] and [email protected] |
Here is a repo with repro: https://github.com/borekb/gatsby-issue-4820-demo |
Yeah, this looks like a yargs bug — could you file an issue upstream and try to get it fixed there? |
@cricrio Does this look like a yargs but to you or a Gatsby misconfiguration? |
A PR updating yargs by a couple of major versions was just merged. Maybe we can re-check this once a new version of gatsby-cli has been published. |
I'm able to reproduce this on my mac if that helps:
Does the same thing when run by NPM:
If there's any info I can give you guys about my setup I'm happy to. |
While working on #7187, I ran into the same issue,
|
PR #4755 introduced a
--no-uglify
flag but it doesn't work for me when invoked from an npm script or vianpx
:As a workaround, it is possible to do
or
Note: I previously made it sound like the CLI parsing is incorrect but doing
$ gatsby build --no-uglify
(using global gatsby-cli) works correctly. Sorry!The text was updated successfully, but these errors were encountered: