vuejs / laravel-elixir-vue-2

Laravel Elixir Vue 2.0 support plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure to mount when extending elixir

tam5 opened this issue · comments

I have had a package which extends elixir by wrapping up and using some of the built in elixir functions (meaning the package itself uses mix.scripts etc.).

Before vue-2 I was able to do this:

elixir.extend('speak', function (message) {
  elixir(mix => {
    console.log(message);
  });
});

elixir(mix => {
    mix.sass('app.scss')
       .speak('Hello, World!')
       .webpack('app.js');
});

However, with vue-2 I am now getting the error:

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

If I simply comment out the part where I use mix, then everything loads fine:

elixir.extend('speak', function (message) {
  console.log(message);
});

I am trying to understand this behavior but so far I have not been able to figure it out, or how to solve the issue. Any explanations would be helpful.

Actually, this has nothing to do with vue. The problem lies with using multiple elixir(mix... calls.