Vue-loader: HelloWorld projet - Module build failed: SyntaxError: Unexpected token {

Created on 4 Nov 2017  Â·  8Comments  Â·  Source: vuejs/vue-loader

Version

13.4.0

Reproduction link

https://github.com/nagyzsolthun/vue-syntax-error

Steps to reproduce

  1. confirm that the project builds with the dependencies set in the current package.json (npm install; webpack)
  2. update vue-loader to 13.4.0 in package.json
  3. run npm upate
  4. build again

What is expected?

successful build

What is actually happening?

ERROR in ./app.vue
Module build failed: SyntaxError: Unexpected token {...

Most helpful comment

@aeolusheath For what it's worth, I had this happen when testing against a very old nodejs 4.x version, but 6.x and newer versions work fine.

All 8 comments

Can't reproduce that:

bildschirmfoto 2017-11-04 um 10 46 12

I reinstalled my OS, build finishes as expected.

@LinusBorg bro, I meet the same error:

"Module build failed: SyntaxError: Unexpected token {"

vue-loader version is 13.5.0, but as u say I modify it to 13.4.0 . error occur。

versions as below:

image

That screenshot doesn't really help me in understanding your problem. simply saying "same error" doesn't help either.

You likely just have to freshly update and re-install(!) all dependencies (i.e., delete /node_modules and package-lock.json, and run npm install again).

If it continues to be a problem, please:

  1. Open a new issue
  2. show the exact error that'S happening
  3. provide some runnable code that reprodues the problem.

@aeolusheath For what it's worth, I had this happen when testing against a very old nodejs 4.x version, but 6.x and newer versions work fine.

@dannon yes u r right

Seems like it’s related to Node version. Is latest vue-loader compatible with Node 4?

@aeolusheath You save my day. Thank you.

Was this page helpful?
0 / 5 - 0 ratings