Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rameezisrar's avatar

Unable to create another Vue instance on app.js

On the Spark>resources/assets/js/app.js

require('spark-bootstrap');

require('./components/bootstrap');




var app = new Vue({
    mixins: [require('spark')]
});


new Vue({
  el: '#app',

  data: {

      state: 'on'
  }

});

After compiling i get this console error:

 [vue warn] Cannot find element: #app

The output of blade.php file on the browser :

{{state}}

I don't understand why it's throwing me this error. That was running just fine on laravel but not spark

0 likes
1 reply
rameezisrar's avatar

When I try this

require('spark-bootstrap');

require('./components/bootstrap');




var app = new Vue({

    data:{

      state: 'on'

    },

    mixins: [require('spark')]
});

then the console error resolves but the output is the same. This is what I get in the browser

{{state}}

On console, if I do

$vm0.state

i get the state output which is "on"

Please or to participate in this conversation.