P
P
pegas2020-02-17 20:49:21
JavaScript
pegas, 2020-02-17 20:49:21

What to do with IE11: "Object does not support assign property or method"?

Object doesn't support assign property or method

There seems to be answers on the net, but nothing helped. Maybe the swiper slider uses ES6 here is the .babelrc

file

{
    "presets": ["@babel/preset-env"],
    "plugins": ["@babel/plugin-transform-object-assign"]
}


webpack.config.js

const path = require('path');

module.exports = {
  mode: process.env.NODE_ENV, // development не сжатый а продакшн сжатый
  entry: ['./scripts/main.js'],
  module: {
    rules: [
      {
        exclude: [/node_modules\/(?!(swiper|dom7)\/).*/, /\.test\.jsx?$/],
        test: /\.jsx?$/,
        use: [{ loader: 'babel-loader' }],
      }
    ]
  },
  output: {
    filename: '[name].js',
    path: path.resolve(__dirname, 'www/scripts')
  }
};


package.json

{
  "name": "gulp",
  "version": "1.0.0",
  "main": "index.js",
  "browserslist": [
    "> 1%",
    "not ie < 11",
    "not OperaMini all"
  ],
  "license": "MIT",
  "scripts": {
    "dev": "cross-env NODE_ENV=development gulp dev",
    "build": "cross-env NODE_ENV=production gulp build"
  },
  "devDependencies": {
    "@babel/core": "^7.1.2",
    "@babel/plugin-transform-object-assign": "^7.8.3",
    "@babel/plugin-transform-property-mutators": "^7.8.3",
    "@babel/preset-env": "^7.1.0",
    "babel-loader": "^8.0.4",
    "browser-sync": "^2.24.7",
    "cross-env": "^5.1.5",
    "csso": "^3.5.1",
    "eslint": "^5.4.0",
    "gulp": "^4.0.0",
    "nunjucks": "^3.1.3",
    "postcss": "^7.0.2",
    "postcss-easy-import": "^3.0.0",
    "postcss-mixins": "^6.2.0",
    "postcss-nested": "^3.0.0",
    "postcss-object-fit-images": "^1.1.2",
    "postcss-preset-env": "^5.3.0",
    "prettier": "1.14.2",
    "request": "^2.88.0",
    "stylelint": "^9.4.0",
    "svg-sprite": "^1.4.0",
    "svgo": "^1.1.1",
    "webpack": "^4.23.1"
  },
  "dependencies": {
    "lozad": "^1.9.0",
    "object-fit-images": "^3.2.4",
    "svgxuse": "^1.2.6",
    "swiper": "^5.3.1",
    "web-animations-js": "^2.3.1"
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Prokhorov, 2020-02-17
@boompro

"browserslist": [
"> 1%",
"not ie <= 11",
"not ie_mob > 0",
"not OperaMini all"
],
have you tried that?
Here you can check

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question