0

Does any one knows about this ? My app is working fine on Chrome,Firefox, IE but now working on Safari browsers..... Safari browser raises error below are the errors

Webpack error on safari browser =>

  1. SyntaxError: Unexpected token 'const' in vendor.bundle.js:102174

  2. TypeError: 'undefined' is not an object (evaluating 'modules[moduleId].call') in inline.bundle.js:55

Does any one know how to add support for safari browsers old and new version both for es6??? or how to solve these errors

mpunit30
  • 381
  • 9
  • 26
  • one of your libraries uses es6 and does not transform it to es5 / you attach a wrong file to your bundle. Find and fix this and your issue will be solved – smnbbrv Oct 27 '17 at 09:27
  • Ok great!! But how to find where this es6 reference is getting attached. So that i can remove it or how to debug or make es6 transformable to es5 – mpunit30 Oct 27 '17 at 09:44

1 Answers1

1

you can use babel transpiler for that, check this https://shinesolutions.com/2015/07/07/es6-with-babel-js/

npm install --save-dev babel-loader babel-core babel-preset-env webpack
and inside your webpack config:
module: {
 rules: [
{
  test: /\.js$/,
  exclude: /(node_modules|bower_components)/,
  use: {
    loader: 'babel-loader',
    options: {
      presets: ['env']
    }
  }
}
]
}
Fateh Mohamed
  • 20,445
  • 5
  • 43
  • 52