Skip to content
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

Feature detection error in babel-preset-env and IE11 #7395

Closed
nanomad opened this issue Feb 19, 2018 · 3 comments · Fixed by #7400
Closed

Feature detection error in babel-preset-env and IE11 #7395

nanomad opened this issue Feb 19, 2018 · 3 comments · Fixed by #7400
Labels
Has PR i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: preset-env

Comments

@nanomad
Copy link

nanomad commented Feb 19, 2018

Choose one: is this a bug report or feature request? Bug

Input Code

    var p = Promise.resolve(0);
    Promise.all([p]).then(function(outcome){
        alert("OK");
    })

Babel/Babylon Configuration (.babelrc, package.json, cli command)

See demo code:
https://github.com/nanomad/babel-promise-test/

Inside webpack.config.js

                    use: {
                        loader: 'babel-loader',
                        options: {
                            presets: [
                                ['@babel/preset-env', {
                                    modules: false,
                                    useBuiltIns: 'usage',
                                    targets: [
                                        "> 1%",
                                        "last 2 versions",
                                        "not ie <= 8"                                    
                                    ]
                                }],
                                ['@babel/preset-stage-2',{
                                    useBuiltIns: true
                                }]
                            ],
                            plugins: [
                                ['@babel/plugin-transform-runtime', {
                                    polyfill: false,
                                    generator: false
                                }]
                            ]

Expected Behavior

Alert is shown in IE10

Current Behavior

Unhandled promise rejection TypeError: [object Object] is not iterable!

Possible Solution

Missing es6.array.iterator Polyfill

Context

This blocks vue apps generated by vue-cli from working under IE11. See:
vuejs/vue-cli#858

Your Environment

software version(s)
Babel ^7.0.0-beta.40
node 8.9.4
npm 5.6.0
Operating System Windows 10 64bit
Browser IE 11
@babel-bot
Copy link
Collaborator

Hey @nanomad! 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.

@nanomad
Copy link
Author

nanomad commented Feb 19, 2018

Already discussed in chat with @zloirock

@gcondello I didn't test it, but looks it's a feature detection issues with babel-preset-env with useBuiltIns: 'usage'. It adds just es6.promise, but not es6.array.iterator which required for Promise.all in your case.

@nanomad nanomad changed the title Feature detection error in babel-preset-env and IE10 Feature detection error in babel-preset-env and IE11 Feb 19, 2018
@nanomad
Copy link
Author

nanomad commented Feb 19, 2018

Updated title to reflect that it happens on IE11 and not 10

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 25, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has PR i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: preset-env
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants