-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Babel attempts to use wrong runtime helpers in version 7.22 #15663
Comments
Hey @fire332! 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 share your package.json? |
Working babel versions from minimal repo: {
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "7.21.8",
"@babel/plugin-transform-runtime": "7.21.4",
"@babel/preset-env": "7.21.5",
"babel-loader": "^9.1.2",
"babel-plugin-polyfill-corejs3": "^0.8.1",
"babel-plugin-polyfill-regenerator": "^0.5.0",
"webpack": "^5.84.1",
"webpack-cli": "^5.1.1"
},
"dependencies": {
"@babel/runtime": "7.21.5",
"core-js-pure": "^3.30.2",
"regenerator-runtime": "^0.13.11"
}
}
|
Thanks! This behavior is expected, and it's a breaking change introduced in Your configuration is asking Babel to use inject "pure" imports to polyfills for the features that you are using. However, Babel previously had a problem: it was injecting imports to helpers (
We need to improve the docs around this behavior, specifically in https://github.com/babel/babel-polyfills/tree/main/packages/babel-plugin-polyfill-corejs3 and https://github.com/babel/website/blob/main/docs/plugin-transform-runtime.md. |
Could this be related? And I'm now expected to install |
You should only need |
馃捇
How are you using Babel?
babel-loader (webpack)
Input code
export async function x() {
return 1
}
Configuration file name
babel.config.js
Configuration
Current and expected behavior
Current behavior: log spam of
Can't resolve '@babel/runtime-corejs3/helpers/xxx' in 'yyy'
Expected: helpers are resolved into
@babel/runtime
instead of@babel/runtime-corejs3
Environment
Last known good babel versions:
npmPackages:
Possible solution
No response
Additional context
This wasn't an issue in 7.21
The text was updated successfully, but these errors were encountered: