3.0.0-beta.1
https://github.com/nanomad/vue-cli-promise-test
Promise.all([0]).then(function() {
  alert("ALL OK");
})
yarn serveAn alert with "ALL OK" appears
Unhandled promise rejection TypeError: 0 is not iterable!Seems like the babel preset for vue is pulling in the wrong polyfill
No, the template works fine - Your Javascript is invalid. Promise.all() expects an array of Promise objects - you passed it an array containing a Number.
The error message tells you that Promise itself has been polyfilled - it's a promise rejection error after all, and it tells you that you passed it the wrong kind of content.
@LinusBorg Please re-open because the following fails as well:
var p = Promise.resolve(0);
Promise.all([p]).then(function() {
  alert("ALL OK");
});
with error:
Unhandled promise rejection TypeError: [object Object] is not iterable!
Also, it's totally legal to use an object in place of a promise. See:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
Ok, so i've done some digging by playing around with the built-in babel preset (@vue/babel-preset-app).
Seems like the culprit is the following piece of code:
If I switch polyfill to true babel will insert the non-global polluting version of the Promise polyfill that works properly on IE10
Then the question is why the normal polyfill doesn't work on IE10?
And the side-question is why do you have to support IE10? Poor guy, you have my sympthy :(
I don't think we want to add the ponyfills from babel-transform, as some libs (like vuex) need them available as globals anyway, so we would have to include a polyfill as well, which would blow up code size etc.
@LinusBorg I think I can manage to leave IE10 out but I was a bit surprised it didn't work since it was theoretically included in the list of supported browsers.
Given that I can reproduce it successfully without vue, do you think it may be worth opening a ticket in the babel repo? Maybe that combination _is not supposed to work on IE10_
Filed a babel issue, seems like a feature detection error on IE10
@LinusBorg I'm dumb... It's IE11 (the one available on Windows 10)
Looks like a fixing PR has been merged into Babel and should be fixed in the next Babel 7 release.
Closed as it's fixed in Babel 7.0.0-beta.46
I still get the same error with 7.0.0-beta.46
Then you should probably report that in the Babel repo.
Most helpful comment
Then you should probably report that in the Babel repo.