Babel Preset does not provide support on IE11 for Object.assign - “Object doesn't support property or method 'assign'”

前端 未结 2 403
清酒与你
清酒与你 2021-02-01 15:50

I am using babel-preset-env version - 1.6.1 for my react app, i am getting a error on IE :- Object doesn\'t support property or method \'assign\'

2条回答
  •  感情败类
    2021-02-01 16:32

    You need Babel Polyfill.

    Either import it in your entry JS file, or use Webpack.

    import "babel-polyfill";
    

    or in webpack.config.js

    module.exports = {
      entry: ["babel-polyfill", "./app/main"]
    }
    

    NOTE : babel-polyfill Should be imported on very top else It will not work

提交回复
热议问题