Uncaught SyntaxError: Unexpected token *

if (!$navEl.is('.subnavbar')) $navEl[0].style.opacity = (1 - (percentage  ** 0.33);

Seems this err is caused by the using of **, which is not supported in some browsers(safari of iOS
10, wechat browser, etc…), and I don’t know how to fix it with my webpack settings. Any ideas?


it seems that f7/dom7 are included in babel config file. But don’t know why ** not transformed.

  {
    test: /\.js$/,
    loader: 'babel-loader',
    include: [
      resolve('src'),
      resolve('test'),
      resolve('node_modules/webpack-dev-server/client'),
      resolve('node_modules/framework7'),
      resolve('node_modules/framework7-vue'),
      resolve('node_modules/template7'),
      resolve('node_modules/dom7'),
    ]
  },

For me sounds like wrong babel configuration then, make sure your babel settings include this transform https://babeljs.io/docs/plugins/transform-exponentiation-operator/

still not working.

i cloned the Vue.js Webpack template project;
npm i transform-exponentiation-operator --save-dev;
and added it to .babelrc.

{

“presets”: [
[“env”, {
“modules”: false,
“targets”: {
“browsers”: ["> 1%", “last 2 versions”, “not ie <= 8”]
}
}],
“stage-2”
],
“plugins”: [“transform-vue-jsx”, “transform-runtime”, “transform-exponentiation-operator”]
}

Anything I missed? :sleeping: