Getting Error Promise is undefined in IE11

后端 未结 7 727
刺人心
刺人心 2020-12-24 11:29

I am converting React code to typescript, target in tsconfig is es5.

on running in IE 11 i get an error \"Promise is undefined\"

I know i need to polyfill,bu

7条回答
  •  粉色の甜心
    2020-12-24 11:41

    You can use the babel-polyfill library which can be found in cdnjs and offers a plethora of polyfills that I found useful for IE compatibility (including Promises).

    Note that you don't have to use the babel compiler to use this; simply load the script and you are good to go :)

提交回复
热议问题