Vue-select: Unexpected token punc «(», expected punc «:»

Created on 29 Jun 2016  Â·  4Comments  Â·  Source: sagalbot/vue-select

I'm using the latest vue-select version here in a project with the latest vue webpack template.

Everytime I try to build the app (with npm run build), the following error happens:

ERROR in static/js/0.e334c585f73c09dc319f.js from UglifyJs
Unexpected token punc «(», expected punc «:» [./~/vue-select/src/mixins/ajax.js:45,0]

The app works including the vue-select behavior, but the arrow glyph becomes strange as shown below:

vue-select visual bug

bug duplicate

Most helpful comment

@sagalbot thank you very much for explaining it.

I'm using the latest webpack template for vue-cli. In case anyone else wants to know exactly where I put that, I updated the webpack.base.config.js file, this way:

{
  test: /\.js$/,
  loader: 'babel',
  include: [
    path.resolve(__dirname, '../config'),
    path.resolve(__dirname, '../build'),
    path.resolve(__dirname, '../src'),
    path.resolve(__dirname, '../node_modules/vue-select'),
  ]
}

All 4 comments

This is a bug (#57, #69) that will be fixed in the next release - essentially babel doesn't get applied to the mixins in src/mixins/, so they are not transpiled to ES5. The next release will be precompiled so that dev's don't have to modify the build process.

What's your build process? If you are using webpack, you can configure babel-loader to run on the files.

{
        test: /\.js$/,
        loader: 'babel',
        include: [
          projectRoot + '/src',
          projectRoot + '/test',
          projectRoot + '/node_modules/vue-select'
        ]
}

@sagalbot thank you very much for explaining it.

I'm using the latest webpack template for vue-cli. In case anyone else wants to know exactly where I put that, I updated the webpack.base.config.js file, this way:

{
  test: /\.js$/,
  loader: 'babel',
  include: [
    path.resolve(__dirname, '../config'),
    path.resolve(__dirname, '../build'),
    path.resolve(__dirname, '../src'),
    path.resolve(__dirname, '../node_modules/vue-select'),
  ]
}

@ErickPetru this is now fixed in v1.3.0.

i have already resolved this error. file's path is error, please check it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FrancescoMussi picture FrancescoMussi  Â·  3Comments

gilles6 picture gilles6  Â·  3Comments

NexoraSolutions picture NexoraSolutions  Â·  3Comments

pud1m picture pud1m  Â·  3Comments

mattWalters0 picture mattWalters0  Â·  3Comments