After using Webpack with Vue to compile a project, when I open a page that uses a Vue component I get:
[Vue warn]: Failed to mount component: template or render function not defined.
and in place of the component Vue renders
<-- function (a, b, c, d) { return createElement(vm, a, b, c, d, true); } -->
Why does this error happen?
Note: I've created an MCVE for this problem. The exact Webpack config used is:
module.exports = {
entry: __dirname + '/display.js',
output: {
filename: 'bundle.js'
},
module: {
rules: [ { test: /\.vue$/, loader: 'vue-loader' } ]
}
}
const Vue = require('vue/dist/vue.common.js')
toconst Vue = require('vue')
. See github.com/vuejs/vue-router/issues/713 and vuejs.org/v2/guide/… for details. – ceejayozVue is not a constructor
. I've tried all the files indist
as well, none of them work. – RedHattervue-cli
? github.com/vuejs/vue-cli – ceejayoz