nprogress
nprogress copied to clipboard
Error in beforeCreate hook: "SyntaxError: missing ) after argument list"
trafficstars
- vue init webpack test
- npm install nprogress
- 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')
- edit App.vue
<template>
<nprogress-container></nprogress-container>
</template>
<script>
import NprogressContainer from 'vue-nprogress/src/NprogressContainer'
export default {
components: {
NprogressContainer
}
}
</script>
-
npm run dev works fine
-
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
Just encountered this too. Interestingly, only happens when dev server has --hot flags for HMR, removing that prevents the error for me
Same here: with --hot flag in webpack.dev.conf.js it produces that same error.