vue 2.0 Failed to mount component: template or render function not defined vue 2.0 Failed to mount component: template or render function not defined vue.js vue.js

vue 2.0 Failed to mount component: template or render function not defined


Like my comment in the question, I had the same problem.In my case I had two elixir calls like this:

elixir(mix => {    mix.browserSync({        proxy: 'example.dev',        open: false    });});elixir(mix => {    mix.sass('app.scss');    mix.webpack('app.js');});

I don't know why, but the two elixir calls are breaking webpack.I change my gulpfile to:

elixir(mix => {    mix.sass('app.scss');    mix.webpack('app.js');    mix.browserSync({        proxy: 'example.dev',        open: false    });});

@retrograde, thx for your hint in your comment :)

Edit:See this Laravel Elixir Issue


Hi have had this issue before when playing around with VueJs 2.0 RC I think what I did was create a webpack.config.js in the project root and add the following:

module.exports = {    resolve: {        alias: {            vue: 'vue/dist/vue.js',        }    }};

Also not sure it would make a difference but before trying the above maybe add "vue": "^2.0.1", to your package.json file and do npm install (or just npm install vue)


Even if your component has no options, its script tag still has to export an empty object, so that vue-loader can inject the render function into it:

<template>   <div class="top">     <p>hi</p>   </div></template><script>    export default {};</script>