As the title says, even I\'d like to use babel-polyfill to allow me to use promises in my code, but I get that undefined error in IE11.
I\'ve been trying to make this wo
You need to import Babel polyfilly before any other non-polyfill code in your JS entry point:
import 'babel-polyfill';
or if you have already switched to Babel 7:
import '@babel/polyfill';
Also note that you should switch your presets to preset-env
. I'd recommend you upgrade to Babel 7 and use @babel/preset-env
.
Assuming you have done the switch to Babel 7, this is what your .babelrc
should look like:
{
"presets": [
[ "@babel/preset-env", {
"targets": {
"browsers": [ "last 1 version", "ie >= 11" ]
}
}]
]
}
From Babel 7.4.0 you need to install and import these libraries:
import "core-js/stable";
import "regenerator-runtime/runtime";
like they said here: https://babeljs.io/docs/en/babel-polyfill