-
Notifications
You must be signed in to change notification settings - Fork 343
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
Breaks under yarn >=3.0.0 #2332
Comments
@leaumar it looks like the issue is actually between web-ext and yarn pnp module linker, because it seems to work correctly when I'm pretty sure that the code that is raising that exception is this one:
and my guess is that yarn pnp module linker may be confused by the fact that we are importing yargs's Parser class from "yargs/yargs" here:
I have never used yarn v3 and so this was the first time I actually learned of this yarn pnp feature, and so unfortunately I would need to dig much more to determine how we may achieve that in a way that doesn't behave differently in this yarn v3 mode. Hopefully these details may help you to workaround the issue in the short run, until we may be able to take a deeper look and got a better picture of the reasons behind that unexpected behavior. |
I've worked around it for now by downgrading to yarn 2.4.3. It kinda sounds to me like yargs doesn't export Parser correctly. |
Ironically, there are other issues like eslint and ts-eslint with their recent updates (v8 and 5) requiring yarn >=3 now 😅 It's crazy how fickle the nodejs ecosystem is. |
I just tried messing around with program.js and then debugging the faulty line during The only breadcrumb I can find in yargs itself is the dissimilarity between
The rubber duck in me that isn't into npm packages and nodejs resolution hacks asks if the missing |
Changing |
Jesus christ, that fixes it... All I did was open the web-ext dependency zip in the yarn cache, edit web-ext.js to change the one occurence of "yargs/yargs" to "yargs/helpers", and then re-ran the webext command in my repository, getting a successful run instead of the (I'd just like to state to the open air that I'm getting fed up with all these "javascript as a language is evolving and stuck in buggy transition states on all fronts at once" issues) |
❤️ @leaumar as someone that also got to investigate quite some "surprising issues with npm dependencies and co." over the last few years, I can't thank you enough for going deep into the yarn "rabbit hole" and identified a more than reasonable fix for the issue you were facing. |
Is this a feature request or a bug?
Bug: crashes with a runtime error under a recent update of a popular package manager.
What is the current behavior?
This commit broke web-ext in my 6 addon projects. Updating yarn from 2.x to 3.0.0 and later causes the following error whenever invoking web-ext in any way (build, lint, run):
Rverting back to 2.4.3 solves the error.
Sole exception to this is
yarn web-ext --version
, which just works.The folks over at yarn are adamant that issues like this are not on their table. 😕 I hope it will be received better here.
What is the expected or desired behavior?
Web-ext commands like
run
don't instantly fail with an error.Version information (for bug reports)
14.18.1
6.14.15
6.4.0
Thanks
The text was updated successfully, but these errors were encountered: