-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
jQueryUI incompatible with js/app.js #28984
Comments
I just tried this out on a (relatively) fresh install of Laravel and the datepicker worked as expected without commenting out the That being said, I am not sure how those environment differences would cause the issue. Did you try it with a fresh install of Laravel? |
Yes |
Can also be resolved if defer is removed from the script. <script src="{{ asset('js/app.js') }}" defer></script>
<script src="{{ asset('js/app.js') }}" ></script> |
@570studio Did you run php artisan make:auth ? |
[5.8] Fixes Issue #28984, defer in app.js script prevents jquery components from loading.
@mikestratton I did run |
Hi, @570studio After running Now the removal of the |
Yeah the removal of defer doesn’t make sense without also moving the script tag to the bottom. Not sure why that was merged. |
Revert "[5.8] Fixes Issue #28984, defer in app.js script prevents jquery components from loading."
I've reverted the pr for now. |
The state of this after the revert, is more than sufficient for a starter scaffold. Of course there will be situations where you'll need to change it, but that should be handled in the individual app as the need arises. As it is, it suffices the 80% use-case. |
I strongly disagree. I am using jQuery in some but not all html forms. I create a view just for this form. There is no need to compile all the required code in JavaScript when it is not widely used. I have found a lot of mid level developers struggling with this. Just Google “jquery not working with Laravel”. The ability to add an additional script that does not break the site should be the default working state. developers should not be required to compile everything. It should be an option and is a good coding practice to compile, but lack thereof should not break the app. The “defer” seems to be a symptom of a much bigger problem. Ease of use is a must and what has drawn many to laravel. Ignoring this bug will only offer continued frustration for thousands of developers. |
If @taylorotwell agreed with the initial commit, why revert his commit? |
This pr breaks the most fundamental concept of mixing javascript and html. |
Yes but so does the current state with defer. |
If moving the script to the bottom of the page allows the use of jQuery libraries, why not just do that? |
So, in essence, it is ok to deliver an html page that reads only one script? |
We won't be reverting this. Feel free to change this in your own codebase. |
Ok, thanks for the review. |
answer:
|
Perfecto!! me funciono!! |
thanks a lot, It was huge relief really I don't know how to thank you |
I've been struggling with this myself and wasted many hours looking for a solution. |
-- XAMPP Control Panel v3.2.3
-- Windows 10
-- Jetbrains PhpStorm
Description:
jQueryUI Datepicker works fine when ran outside of Laravel application. Here is the code: https://jqueryui.com/datepicker/ Implementing the same code from within any laravel blade view returns a "datepicker" not defined in the developers console(browser).
Commenting out the line:
in the app.blade.php file and the jquery date picker works.
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: