vue.js – ERROR in bundle.js from UglifyJs – SyntaxError: Unexpected token punc «(», expected punc «:»
344
post-template-default,single,single-post,postid-344,single-format-standard,bridge-core-3.0.1,qodef-qi--no-touch,qi-addons-for-elementor-1.5.3,qode-page-transition-enabled,ajax_updown,page_not_loaded,,vertical_menu_enabled,side_area_uncovered_from_content,qode-theme-ver-28.7,qode-theme-bridge,disabled_footer_top,qode_header_in_grid,wpb-js-composer js-comp-ver-6.8.0,vc_responsive,elementor-default,elementor-kit-6

vue.js – ERROR in bundle.js from UglifyJs – SyntaxError: Unexpected token punc «(», expected punc «:»

vue.js – ERROR in bundle.js from UglifyJs – SyntaxError: Unexpected token punc «(», expected punc «:»

I started playing with vue.js and used vue-cli to scaffold a new project. It all worked well until I tried npm run build. Then I got the following error:

ERROR in build.js from UglifyJs
SyntaxError: Unexpected token punc «(», expected punc «:» [build.js:8643,6]

It took me a while to find the answer, but I found it on Stackoverflow here:
http://stackoverflow.com/questions/41254538/error-in-bundle-js-from-uglifyjs

Basically I needed to create a .babelrc file as follows:

{
 "presets": [
  ["es2015", {"modules": false}]
 ]
}

That solved the problem for me, and the build is now successful.



Mastodon