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
for of on HTMLCollection (getElementsBy) throws error when targets to ie11 #12068
Comments
Hey @MaxLOh! 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." |
Couple things... (a) you'll want to exclude module: {
rules: [{
test: /\.js$/,
+ exclude: /node_modules/,
use: {
loader: 'babel-loader', (b) you'll also want to enable the use: {
loader: 'babel-loader',
options: {
presets: [
["@babel/preset-env", { "useBuiltIns": "usage", "targets": { "ie": "11" }, "corejs": 3 }]
- ]
+ ],
+ "plugins": [
+ ["@babel/plugin-transform-for-of", {
+ "allowArrayLike": true
+ }]
+ ]
} |
Duplicate of #11763 |
@existentialism Thx. Shouldn't (a) be documented in @babel/preset-env documentations? |
Probably it should be included in |
Can we add |
@JLHwung I'm down for that |
I think that we can only do that in |
@nicolo-ribaudo But @babel/preset-env uses core-js by default. New comers may get confused as a basic/minimal configuration not resulting in a working output. |
Bug Report
Current behavior
The output of @babel/preset-env and core-js failed to run on browsers.
Demo Project: https://github.com/maxloh/babel-failed
Open index.html and you will see the following error in console.
Input Code
Expected behavior
The output run in browser with no errors.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
babel.config.js
Environment
loader
Possible Solution
Additional context
Add any other context about the problem here. Or a screenshot if applicable
The text was updated successfully, but these errors were encountered: