-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Pass version to presetEnv #5946
Conversation
This change in babel babel/babel#12934 breaks Parcel if version doesn't pass into presetEnv(). By setting version as 7.13.0 presetEnv() will continue other checking, just like the logic before.
|
I think this is a v1 only bug? This code path won't actually be hit in v2 because config.isSource is always true. |
Q: If that code path won't be hit, the code can just be deleted? |
@@ -48,7 +48,7 @@ export default async function getEnvOptions( | |||
|
|||
function getNeededPlugins(targets: BabelTargets): Array<PresetEnvPlugin> { | |||
return presetEnv( | |||
{assertVersion: () => true}, | |||
{version: '7.13.0', assertVersion: () => true}, // version is required since https://github.com/babel/babel/pull/12934/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 7.12.0 (
"@babel/core": "^7.12.0" |
require("@babel/core").version
.
Ideally, the safest approach would be { ...require("@babel/core"), assertVersion: () => true }
.
Yes, parcel/packages/transformers/babel/src/config.js Lines 38 to 41 in 806cc65
means that this whole if statement could be removed because it's never reached if parcel/packages/transformers/babel/src/env.js Lines 30 to 41 in 806cc65
|
@nicolo-ribaudo @mischnic so looks like this is a v1-only issue and what can I do if I also want to apply this change to v1? (sorry I am a newbie and I want to help 🙏) |
@bemnlam Parcel 1 is on the |
@devongovett @mischnic could y'all review this change, particularly for v1? #5943 is being felt quite massively across the community as I'm sure you're seeing. I was going to write this PR myself (even though I'm only indirectly impacted) before finding it was already done here. Currently, the only solution right now is either a |
v1.12.5 has a fix. Please see #5943 (comment) |
↪️ Pull Request
Fixing #5943
This change in babel breaks Parcel if version doesn't pass into
presetEnv()
. By setting version as 7.13.0presetEnv()
will continue other checking, just like the logic before.