-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Babel config cached incorrectly, throwing duplicate plugin error #1828
Comments
Looks like a Babel compilation issue. We cache the results, and do little invalidation at the moment (the Is there any more detail about which plugin is the duplicate? What happens if you remove just |
Tried a bunch of things, but today I cannot reproduce this any more. I checked both beta 5 and 6. Best guess is it was a bug in a subdependency that got fixed (probably in Babel itself). Wish I had more details... 😄 |
Hmm this started happening again for me as of beta 7. It's reliable, I can switch between beta 6 and 7 with a nuke Same cryptic message. It doesn't show which plugins or presets are duplicated. And touching package.json still matters. Basically, it always fails the first time, then I have to modify package.json, then I have to run AVA again and let it fail, then put package.json back the way it was originally, run AVA again and finally it will pass. I have been trying to isolate if specific parts of package.json are important and I think it is BTW are you sure the below statement is true?
When I remove
However, on the buggy versions of AVA (e.g. beta 7), if I then add the plugin back to my config after letting it fail once, then it will pass. |
@sholladay are you using RC1 releases for your Babel plugins? |
I am, yes. I'm not seeing any peerdependency warnings related to Babel, but downgrading to |
@sholladay I'd like to get to the bottom of this actually. Downgrading the version just means there's two different plugins being used, so Babel doesn't complain… but once they release their stable version npm's dependency deduping will make the plugins be the same again. If you could reproduce this setup outside your codebase that'd make it a bit easier for me to figure out the problem. I suspect it may be because we install that syntax plugin ourselves. We should be detecting it's already there, but maybe there's another way to install it where it doesn't trip up Babel. |
Okay here's your minimal repro!
The result, for me, is the same stack trace as I originally posted. I'm currently on Node 8.11.3 and npm 6.3.0, but that doesn't seem to matter in this case. I used |
AVA needs to add syntax plugins for stage-4 features, however it shouldn't do so if the user has already specified them. This fixes the detection of existing plugins by also comparing a `default` export of the plugin package. Fixes #1828.
Thanks @sholladay. Should be fixed with #1912. |
AVA needs to add syntax plugins for stage-4 features, however it shouldn't do so if the user has already specified them. This fixes the detection of existing plugins by also comparing a `default` export of the plugin package. Fixes #1828.
AVA needs to add syntax plugins for stage-4 features, however it shouldn't do so if the user has already specified them. This fixes the detection of existing plugins by also comparing a `default` export of the plugin package. Fixes #1828.
Description
Babel configuration is misbehaving, throwing an error on startup before any tests are run.
My team has been using the configuration below with AVA
1.0.0-beta.4
for a while without trouble. However, it breaks on1.0.0-beta.5
. This seems to be a regression where the Babel configuration is somehow processed or cached incorrectly.There is one super weird part about this bug. If I remove
babel.plugins
from package.json, then run AVA, then put the plugins back and run AVA again, it somehow makes things work (no error is thrown and tests run as expected). Runningnpx ava --reset-cache
and then running AVA again causes the issue to reappear. So this really appears to be cache related, albeit it's broken when there is no cache.Test Source
Anything.
Error Message & Stack Trace
Config
Command-Line Arguments
Relevant Links
Possibly related to #1817.
Environment
Node.js v10.1.0
darwin 17.5.0
ava 1.0.0-beta.5.1
npm 6.0.1
The text was updated successfully, but these errors were encountered: