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

LaraBABA's avatar

How to stop Vue from Loading on certain pages in Laravel 5.5?

Hello,

I am having problems with Vue stopping my Jquery code from working on many pages of my Laravel App.

Is there a way to stop Vue from checking if id=app is loaded please as I keep seeing this error when not added to a page:

app.js:32684 [Vue warn]: Cannot find element: #app

Or shall I still include it but simply as:

<div id="app"></div> 

on the pages where I do not want to use it? Unfortunately I do not know vue yet but I still need it on one single page for a laravel component to work correctly.

Thanks.

0 likes
2 replies
robrogers3's avatar

if (document.getElementById('#app')) { const app = new Vue({ el: '#app' }); }

2 likes

Please or to participate in this conversation.