The object does not support the "assign" property or method in IE11

Configured webpack + babel as follows

Webpack.config.js

...
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        loader: 'babel-loader'
      },
...

.babelrc

{
  "plugins": ["lodash", "transform-object-rest-spread"],
  "presets": [
    ["env", {
      "targets": [
        "> 4%",
        "ie 11",
        "safari 8"
      ]
    }],
    "react",
    "react-optimize"
  ],
  "env": {
    "test": {
      "presets": ["es2015", "react"]
    }
  }
}

I run everything ok in chrom, in IE 11 it gives an error

The object does not support the "assign" property or method

Author: Pavel, 2017-05-06

2 answers

npm install --save-dev babel-plugin-transform-object-assign

.babelrc

{
  "plugins": ["transform-object-assign"]
}
 0
Author: user233428, 2017-10-20 13:06:30

In Node JS, add the package

npm install --save-dev core-js

After that, add it to the file where object.assing is used

import 'core-js/fn/object/assign';

Infa from here: https://github.com/aspnet/JavaScriptServices/wiki/Supporting-Internet-Explorer-11-(or-older)

 0
Author: BERR, 2017-10-19 10:54:35