3

My app is working in in all browsers except IE 11. In IE I get Error: Object doesn't support property or method 'assign'. I have added the babel polyfill, but I still get the same error, like the polyfill isn't compiling correctly.

I installed babel-polyfill npm install --save babel-polyfill.

I changed webpack.base.conf.js as below

module.exports = {
  context: path.resolve(__dirname, '../'),
  entry: {
    babelPolyfill: 'babel-polyfill',
    app: './src/main.js'
  },

The project was started with Vuetify's webpack boilerplate.

Cindy Conway
  • 1,814
  • 3
  • 18
  • 19

2 Answers2

2

You can add

import 'babel-polyfill'

to main.js

I guess that it is not the best solution performance-wise because you load a module that you do not always need. However this should solve your problem while waiting for a webpack wizard to pass by ;)

Guillaume Meral
  • 452
  • 2
  • 8
2

I got it to work. Adding the additional entry point as an array causes it to be part of the same dependency graph, and, therefore built into the same file. Now everything works fine, even in IE 11.

module.exports = {
  context: path.resolve(__dirname, '../'),
  entry: {
    app: ['babel-polyfill', './src/main.js']
  },
Cindy Conway
  • 1,814
  • 3
  • 18
  • 19
  • 1
    Just a note that you may need more polyfills in case you want to target IE10 as well, see https://github.com/vuetifyjs/vuetify/issues/463#issuecomment-352361055 – mrts Jun 12 '18 at 12:12
  • Would this be put into the main.js file? and if so how? Thanks – Bill Dec 20 '19 at 16:41