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
[Bug]: [@babel/preset-env] In Safari, arrow functions with ...args as function parameter always get transpiled regardless of Safari version #13916
Comments
Hey @peripateticus! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
Can you update My guess here is that if You can also add Related: #13912 Will be fixed in #13914 |
Looks like I'm on the latest
Running with
Updated
|
The parameter transform kicks in because Safari has a bug on transforming parameters: https://bugs.webkit.org/show_bug.cgi?id=220517 You can add |
Yep that did it! adding
Thanks for your help on this @JLHwung! Closing this one out. |
💻
How are you using Babel?
@babel/cli
Input code
Configuration file name
No response
Configuration
Current and expected behavior
On our current versions of Babel dependencies specified in our lockfile, this code does not get transpiled and passes through, as is. After updating to latest
@babel/preset-env
(7.16.0), it's now being transpiled. This also doesn't seem correct because all of the syntax in the code is supported in the Safari version specified (15, in this case). It doesn't seem to matter which version of Safari you specify, it always transpiles outer function with the...args
but leaves inner arrow intact.It appears to be another child dependency that is controlling this other than
@babel/preset-env
and@babel/core
but not sure which as many Babel dependencies get updated when updating@babel/preset-env
. So, for example, if I just install versions of@babel/preset-env
and@babel/core
, per our package-lock, it still transpiles that arrow with ...args to a regular function.We caught this because unit tests that were once passing now fail as this code is getting transpiled when it shouldn't be according to our browserslist config.
Environment
Possible solution
No response
Additional context
I have a feeling that this is related to a version of a child dependency locked at a particular version so is difficult to reproduce without sending you the entire lockfile. Let me know which dependencies would affect this and I can send you what our lockfile is showing.
The text was updated successfully, but these errors were encountered: