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

unitedworx's avatar

fresh laravel setup and vue 2 wont work :(

I cant get vue 2 running on my setup so I even setup a new empty laravel project and I am still getting [Vue warn]: Cannot find element: #app

and I do have an element in my template!

basically I just setup a fresh laravel setup using composer create-project --prefer-dist laravel/laravel blog run npm install and then gulp and then simply added <script type="text/javascript" src="js/app.js"></script> in the head in welcome.blade.php along with <div id="app"> <example></example></div> inside the body but still cant get it to work :(

Anyone else having a hard time with vue 2 on a fresh laravel setup?

0 likes
5 replies
unitedworx's avatar

yes laravel-elixir-vue-2 is part of package.json and gulpfile.js

its important to note that I am trying this on a fresh bare laravel setup as mentioned above!

unitedworx's avatar

its a bare setup


require('./bootstrap');

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

const app = new Vue({
    el: '#app'
});

unitedworx's avatar

note to self! remember to add the script and the end of the page! and save the day!

Please or to participate in this conversation.