vue-izitoast icon indicating copy to clipboard operation
vue-izitoast copied to clipboard

Error in IE: SCRIPT1006: Expected ')'

Open dfarrNTST opened this issue 6 years ago • 4 comments

I hate to even note this, but we unfortunately have a requirement to use IE 10+ in our app and we're really fond of this package, but it doesn't seem to work in IE 10+. We get the following error in the Console: SCRIPT1006: Expected ')'. Is IE 10+ not supported? The CodePen example on the Code page fails as well.

dfarrNTST avatar Jan 18 '19 21:01 dfarrNTST

You need to add this plugin to your Babel config : plugins: ["@babel/plugin-transform-parameters"] Also, make sure your plugin is transpiled (with Nuxt.js, I use transpile in the build section of nuxt.config.js).

tehyo avatar Jan 24 '19 14:01 tehyo

I'm fairly new to Vue and created a new project with the latest vue CLI and the babel.config.js file appears as below. How do I add that plugin to it? Also, is the transpile piece required, I've never used Nuxt before nor do we use it for our apps. Will just adding that plugin to the config alone not just work?

module.exports = { presets: [ [ '@vue/app', { useBuiltIns: 'entry' } ] ] };

dfarrNTST avatar Jan 29 '19 15:01 dfarrNTST

The problem likely comes from a plugin which isn't transpiled for old browsers. Babel skips node_modules dependencies. Firstly you need to find which.

Secondly, I can't test with Vue.js but you probably need to add a loader to transpile your plugin, as explained here : https://medium.com/thetiltblog/how-to-transpile-es6-vue-plugins-with-webpack-c5d4286a7737

tehyo avatar Jan 29 '19 17:01 tehyo

This was probably fixed in the last release. I've updated the build pipeline.

arthurvasconcelos avatar Aug 23 '19 10:08 arthurvasconcelos