mdbootstrap / adminlte-laravel

A Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template and Pratt Landing Page with Bootstrap 3.0
MIT License
1.81k stars 508 forks source link

New or modified Vue.js files do not load after npm #220

Closed clebersa closed 7 years ago

clebersa commented 7 years ago

After updating a vue file or adding a new one and registering them in the resources/assets/js/app.css, the vue components do not load/update in the application, even after npm run dev.

Detailed description

I created a fresh installation and tried to play around with Vue.js. Right after creating the project, if I insert the <example></example> tags in some page, the vue component is loaded and works fine. It is like the vue component is loaded somewhere right after the installation. Then, I edited the file at resources/assets/js/components/Example.vue and ran npm install and npm run dev. However, the changes I made did not have effect in the vue component. I also tried to register the Example.vue as a component with a different name in the resources/assets/js/app.css. However, when I tried to use it in some page, the browser thrown an error in the console saying the component was not registered.

I checked the timestamp of the public/js/app.js and it did not change with the npm run dev. So, I believe the problem is this. The public/js/app.js is not getting the changes from resources/assets/js/app.js. I believe that is a bug because it should get those changed every time I run npm run dev, npm run watch or npm run watch-poll. I noticed that no matter what command I run, the public/js/app.js will always be the same, which is the same as vendor/acacha/admin-lte-template-laravel/public/js/app.js, by the way.

it is important to mention that I created a Laravel project and played around with the Example.vue available in the project. It worked fine. After I installed the Acacha AdminLTE Laravel I could not get it working anymore.

Context

Solving this is important to enable users to use Vue.js in applications developed using Acacha AdminLTE Laravel, making them dynamic. Vue.js is a popular tool for helping developing JavaScript applications.

Possible implementation

According to what I investigated, it is related to the scripts performed when the npm run dev command or similar is performed. However, I could not find what exactly needs to be changed to solve the problem.

Your environment

I am using a Linux VM (Ubuntu 14.04.5) with Vagrant (v1.9.1). The VM has:

Thank you for your time. I look forward for your feedback.

acacha commented 7 years ago

Umm I work everyday with vue.js wihut problems I will check that as soon as possible...

clebersa commented 7 years ago

Hello @acacha,

I figured the problem out. It was just a caching matter. My browser cached the app.js generated and it was not seeing the new changes to the file after the execution of npm. After cleaning the cache, it worked fine.

Thanks for your help. Bye.

acacha commented 7 years ago

ok!