axios IE promise doesn't work

后端 未结 2 1211
慢半拍i
慢半拍i 2020-12-18 06:16

I am using axios for ajax communication. I have problem with IE. IE return error about Promise. IE doesn\'t know anything about Promise.

I am writing react/redux but

2条回答
  •  春和景丽
    2020-12-18 06:34

    You have to include a promise polyfill if the browser has no promise implementation. This sounds complicated but there are really good libs.

    The axios docs mention it: axios depends on a native ES6 Promise implementation to be supported. If your environment doesn't support ES6 Promises, you can polyfill.

    If you use just JS without transpiling or bundling you can try es6-promise

    or if you use babel you can take its polyfill

提交回复
热议问题