vue-bulma / nprogress

Progress bars is based on nprogress for Vue
MIT License
184 stars 31 forks source link

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

Open LensHunnel opened 6 years ago

LensHunnel commented 6 years ago
  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')


4. edit App.vue
```html
<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 ---> at node_modules/vue-nprogress/src/NprogressContainer.vue

SamWoolerton commented 6 years ago

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

dizid commented 6 years ago

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