Reputation: 11
I've tried everything :
mix.autoload({
jquery: ['$', 'window.jQuery', 'jQuery'],
});
I've tried jQuery(document).ready(function($){});
I've tried even :
import $ from 'jquery';
window.jQuery = $;
window.$ = $;
But still get the same console error knowing that I'm using Laravel 5.6 with Laravel Mix
Thank you helping
Upvotes: 0
Views: 4783
Reputation: 1
It's an older question but if anyone else ends up reading this I'll went by answer by @kuro and found that adding defer to my own script
<script type="text/javascript" src="{{ URL::asset('js/path/my_script.js') }}" defer></script>
Like that worked for me.
Upvotes: 0
Reputation: 151
If you are not using vue
, delete everything related to vue
from assets/js/app.js
.
And delete "defer" from layouts/app.blade.php
<script src="{{ asset('js/app.js') }}" defer></script>
to
<script src="{{ asset('js/app.js') }}"></script>
This will probably work with jquery.
I don't know when using vue
. sorry.
Upvotes: 15