0
votes

I am working on Laravel and vuejs project, previously vue template was working fine but after upgrading Webpack and related dependencies to v4, it's showing below error:

[Vue warn]: Failed to mount component: template or render function not defined.

How can I solve this issue?

1
are you using vue-cli or ?Loki
You need to provide some code.ssc-hrep3

1 Answers

0
votes

Yes, finally found the issue. Inside the app.js file I previously defined the component as follows:

Vue.component('component', require('./components/component.vue')); 

but after upgrading webpack and related dependencies to v4, we need to require it with .default property.

Vue.component('component', require('./components/component.vue').default);