-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel Mix and JS stop working #887
Comments
Hi @podionne , I'm not familiar with laravel mix. But maybe next issues can help you, the problem was similar:
Yes, it is part of the installation of this package, usually the Good luck, maybe someone can help you better here... |
Thank you @Shidersz you answered my 1st question! :) As for my 2nd question, I still don't know why this line: |
@podionne Have you checked if is not an access / permissions problem? Just in case... |
I have the same problem exactly. |
@aksvitpav Maybe @podionne has found a solution by this time. However, have you checked for permissions problem or errors on the browser's console? |
@Shidersz No errors in console, all permissions are ok. require('../../public/vendor/adminlte/dist/js/adminlte') is my solution too. |
@aksvitpav Not sure what can be the problem. I'm not familiarized with Laravel Mix... However, share your try {
window.Popper = require('popper.js').default;
window.$ = window.jQuery = require('jquery');
require('bootstrap');
require('overlayscrollbars');
require('../../public/vendor/adminlte/dist/js/adminlte'); // working
//require('../../vendor/almasaeed2010/adminlte/dist/js/adminlte'); // not working
} catch (e) {} Can you try commenting out |
Thanks, guys! I haven't found any other solution yet. I'll keep you posted if I find why. |
May be I am wrong but you can't access files outside of the public directories. As public is the root directory of laravel. Detailed information is given in this link. |
Hello. Today I'm create new Laranel 8 project with Laravel-AdminLTE and I do not have this problem anymore. |
@aksvitpav Thanks for sharing. However the problem is rare, I hope someone can found a clue of what is causing that issue on the future. |
yo resolví ese problema con lo siguiente: npm install jquery |
SolutionHello guys, so I had the same issue and start to test a lot of things. At some point we learnt to import the Hope this works for y'all. |
Current Behavior
When I follow the steps in the wiki to enable Laravel Mix, this line in the resources/js/bootstrap.js file seem to not load the JS properly. For example, the sidebar toggles don't work:
require('../../vendor/almasaeed2010/adminlte/dist/js/adminlte'); // not working
For a reason that I don't know, in my project, there is also a folder called /public/vendor/adminlte/dist/js/adminlte.
In the resources/js/bootstrap.js file, when I do this, the javascript is loaded properly and the sidebar toggles start working again:
Do you know why I have this folder?
/public/vendor/adminlte/dist/js/adminlte
Do know know why require('../../public/vendor/adminlte/dist/js/adminlte') is working, but not require('../../vendor/almasaeed2010/adminlte/dist/js/adminlte') even if those files are identicals?
Thanks
Expected Behavior
I would expect require('../../vendor/almasaeed2010/adminlte/dist/js/adminlte') to load JS properly.
The text was updated successfully, but these errors were encountered: