nprogress icon indicating copy to clipboard operation
nprogress copied to clipboard

Error in beforeCreate hook: "SyntaxError: missing ) after argument list"

Open LensHunnel opened this issue 7 years ago • 2 comments
trafficstars

  1. vue init webpack test
  2. npm install nprogress
  3. edit main.js
import Vue from 'vue'
import NProgress from 'vue-nprogress'
import App from './App.vue'

Vue.use(NProgress)

const nprogress = new NProgress({ parent: '.nprogress-container' })

const app = new Vue({
  nprogress,
  ...App
})
app.$mount('#app')
  1. edit App.vue
<template>
  <nprogress-container></nprogress-container>
</template>

<script>
import NprogressContainer from 'vue-nprogress/src/NprogressContainer'

export default {
  components: {
    NprogressContainer
  }
}
</script>
  1. npm run dev works fine

  2. console shows: vue.esm.js?efeb:578 [Vue warn]: Error in beforeCreate hook: "SyntaxError: missing ) after argument list" found in ---> <NprogressContainer> at node_modules/vue-nprogress/src/NprogressContainer.vue

LensHunnel avatar Feb 02 '18 08:02 LensHunnel

Just encountered this too. Interestingly, only happens when dev server has --hot flags for HMR, removing that prevents the error for me

SamWoolerton avatar Feb 26 '18 06:02 SamWoolerton

Same here: with --hot flag in webpack.dev.conf.js it produces that same error.

dizid avatar Mar 29 '18 17:03 dizid