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

Login component missing after running npm install and npm run dev #413

Open norrsken-jagare opened 5 years ago

norrsken-jagare commented 5 years ago

Detailed description

Question: I tried to remove the "Accept Terms and Conditions" part from the registration form (but I found NO legit way to do it in the documentation). Then I attempted to change a little bit of code and run npm install npm run dev and then the login form as well as the registration form are both gone. I later experimented the same on a fresh installation and without any changes in the VueJS codes and the same happened. All Vue.JS components including the two forms went missing and not rendered.

Context

The steps for editing the components should be documented in the documentation and also there seems to be a problem for editing the VueJS components related to this package.

Possible implementation

Not obligatory, but suggest an idea for implementing addition or change.

Your environment

Include as many relevant details about the environment you experienced the bug in and how to reproduce it.

norrsken-jagare commented 5 years ago

Supplementary information:

The exact method for reproducing the issue is: laravel new project-name cd project-name Then install this package composer global require "acacha/adminlte-laravel-installer" adminlte-laravel install At this point everything works fine Then try npm install - npm install fails at this point but the UI is still here But then when trying to run npm run dev then the login UI screws up P.S. on one new project without installing the adminlte-laravel the npm install works fine

Essentially I wanted to change the VueJS files and reload them to my app but even without any change to the vue files the above problem still persists.

chooikw commented 5 years ago

I noticed the app.js is missing in the current master branch, that's why it can't load auth vue components.

Create app.js in resources/assets/js/app.js with following sample and run npm run dev again

/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

window.Vue = require('vue');

/**
 * The following block of code may be used to automatically register your
 * Vue components. It will recursively scan this directory for the Vue
 * components and automatically register them with their "basename".
 *
 * Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
 */

// const files = require.context('./', true, /\.vue$/i);
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));

Vue.component('register-form', require('./components/auth/RegisterForm'));
Vue.component('login-form', require('./components/auth/LoginForm'));
Vue.component('email-reset-password-form', require('./components/auth/EmailResetPasswordForm'));
Vue.component('reset-password-form', require('./components/auth/ResetPasswordForm'));

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

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