Promise not defined in IE 11
See original GitHub issue- Laravel Mix Version: 0.8.1
- Node Version (
node -v
): 6.9.2 - NPM Version (
npm -v
): 412 - OS: Mac OS
Description:
Getting Promise is not defined
in IE 11. Does babel not convert this by default? Where do i add the needed config to polyfill Promise?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Getting Error Promise is undefined in IE11 - Stack Overflow
I am converting React code to typescript, target in tsconfig is es5. on running in IE 11 i get ...
Read more >'Promise' is undefined in Internet Explorer (IE 11) - Syncfusion
We suspect that you haven't referred the ES6 Promise polyfill script in your html page which cause this issue in IE11 browser.
Read more >"'Promise' is undefined" error in IE11 even though targeting ES5
Fails in IE 11 with error SCRIPT5009: 'Promise' is undefined . Only works in IE 11 if bluebird.min.js script element is uncommented.
Read more >'Promise' is undefined in IE11 WordPress
I have used this plugin to create popups in the Divi website I have built: https://wordpress.org/plugins/popups-for-divi/. The popups were not opening in IE...
Read more >JavaScript runtime error: 'Promise' is undefined in IE
While using IE11 it return JavaScript runtime error: 'Promise' is undefined in webdatarocks.js file. Please suggest resolve this issue.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Babel polyfill fixed it. I’m not using Promise myself, but its one of the packages i am importing. Mix should run on all those too right?
npm install --save babel-polyfill
then in bootstrap.js //or some main js fileimport 'babel-polyfill'
Yes, you can simply include
babel-polyfill
, but unless you’re building SPA and you don’t care about the bloat of the size of another framework in your bundle, you should probably not. It’s better to require the stuff you need by hand.It may be reasonable though to provide promise polyfill and, maybe, object-assign, out of the box. For example, this is the snippet from CRA that achieves this exact thing:
This example is particularly good, because it enables rejection tracking.
UPD: In short, I don’t think encouraging the use of
babel-polyfill
is a great idea. But if you think that informing people on it would be too much of a pain, it’s desirable to at least includebabel-polyfill
from withinwebpack.mix.js
, so that developers can easily disable implicit behavior and fall back to a more granular approach.