-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
ie11 Promise supported? #114
Comments
I think the recommendation is that developers should use a promise polyfill in conjunction with fetch (fetch shouldn't provide the polyfill itself). At my company we use either polyfill.io for this (e.g.) or ES6-Promise. |
The promise polyfill is documented in the readme. We use e6-promise at GitHub. |
I've included the es6-promise:
file, but get the same error. |
Dependencies must be included in order. Try moving the promise include above fetch. |
didn't matter what order I put it in.. The result was the same.
now it works. |
We use the pre-2.0 version of es6-promise because they broke it in v2.0: stefanpenner/es6-promise#75 |
<script type="text/javascript" src="html2canvas.js"></script>
<script language="JavaScript" src="jquery.min.js" type="text/javascript"></script>
<script src="es6-promise.js"></script>
The above combination worked for me |
import ES6Promise from 'es6-promise'; ES6Promise.polyfill(); |
Plus it is required by the fetch polyfill, see https://github.com/github/fetch#installation Also see JakeChampion/fetch#114 This fixes the undefined Promise error in internet explorer 11, due to Promises not being supported in Internet explorer and other browsers. See http://caniuse.com/#feat=promises Bug: Issue 4308 Change-Id: I93df9c89a9a98059292038dffe1655c3f4d503c5
This is not working for me. How can I fix the undefined Promise problem? I'm using the latest version of es6-promise. Mark Horsman |
Please note es6-promise is not required if you use babel+babel-runtime or babel+babel-polyfill, The key is you MUST compile whatwg-fetch with babel so that fetch knows the babel's Promise. Here is the snippet from my webpack.config.js, module.exports = {
module: {
loaders: [
test: /\.jsx*$/,
// whatwg-fetch is excluded too, unfortunately.
exclude: [/node_modules/, /.+\.config.js/],
loader: 'babel'
}, {
// whatwg-fetch use Promsie which IE11 doesn't support
test: /\.js$/,
include: [/whatwg-.*/],
loader: 'babel'
}
]
}
}; |
@kairi1227 I have imported as below after installed the using command npm install es6-promise
Please can you help me. |
Solved the purpose in my case. |
apparenlty ie11 does not support Promises so I get this issue:
SCRIPT5009: 'Promise' is undefined
File: fetch.js, Line: 244, Column: 5
The text was updated successfully, but these errors were encountered: