chrmpt's avatar

How to remove vue from my laravel project

Hi everyone.

Don't know, if this was a topic already in the discussions, but I couldn't find it yet, so here we go:

  • I had a project where I used Laravel 7 completely without vue.js. That was great.
  • At the end, I implemented user authentication to the project. I started with the command
php artisan ui vue --auth 

That's because it was mentioned everywhere including on the Laravel documentation.

  • The user authentication works perfectly. However, now I seem to have vue added to my project. I realized this, when I got this warning / error on the console of my productive site:
[Vue warn]: Cannot find element: #app

That's of course true, since I have not implemented vue.js in my project.

Now, I have two questions for you guys:

  1. Is there any way for me to remove vue again without messing with my project?
  2. In general: Did I even have to use that command line in Laravel 7? Since there was already a user table etc. I think, I didn't even have to execute that command, which makes the whole situation even more frustrating to me.

Thank you for your answers already.

0 likes
5 replies
Sinnbeck's avatar

Remove any trace of it from package.json, and remove mix.js() from webpack.mix.js

Run npm install and then npm run dev

1 like
chrmpt's avatar

Thank you so much. I will try that and let you know if that helped.

chrmpt's avatar

unfortunately, the issue is still the same. Did i not delete anything i needed to in the dependencies inside package.json? I still have:

"axios": "^0.19",
 "bootstrap": "^4.0.0",
 "cross-env": "^7.0",
 "jquery": "^3.2",
 "jquery-mask-plugin": "^1.14.16",
 "jquery-ui": "^1.12.1",
 "laravel-mix": "^5.0.1",
 "lodash": "^4.17.13",
 "popper.js": "^1.12",
 "resolve-url-loader": "^2.3.1",
 "sass": "^1.20.1",
        "sass-loader": "^8.0.0"

my webpack.mix.js now only has one line of code:

const mix = require('laravel-mix');
chrmpt's avatar

btw, what i deleted:

package.json:

        "vue": "^2.5.17",
        "vue-template-compiler": "^2.6.10"

webpack.mis.js:

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');
machi7's avatar

There are also references to vue inside resources/js/app.js that you need to delete.

Please or to participate in this conversation.