Have you tried this?
$(document).ready(function() {
$('#flash-overlay-modal').modal();
$('div.alert').not('.alert-important').delay(4000).fadeOut(750);
});
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
This one's got me.
So, when in local development I can view .vue components in safari. This means $('#flash-overlay-modal').modal is not a function. is not being thrown in the console.
Firefox and Chrome do not throw an error either.
However, when the site goes to production safari cannot find $.
Here's what I've done:
.autoload({
jquery: ['$', 'window.jQuery']
})
to the webpack.mix.js file.
Here's the current footerjs.blade file
<!-- jQuery, Popper.js, and JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
<script src="{{ mix('js/manifest.js') }}"></script>
<script src="{{ mix('js/vendor.js') }}"></script>
<script src="{{ mix('js/app.js') }}"></script>
<script>
$('#flash-overlay-modal').modal();
$('div.alert').not('.alert-important').delay(4000).fadeOut(750);
</script>
Any ideas?
Please remember, the console only throws an error in production on Safari Version 13.1.2 (13609.3.5.1.5) - not chrome, or firefox.
Thank you for any insights...
Since you are importing the slim version the jquery, refer to links https://jquery.com/download/
You can also use the slim build, which excludes the ajax and
effectsmodules:
The excluded features https://api.jquery.com/category/effects/ Which means you can't use delay and fadeOut. Maybe use jquery.min.js instead
Please or to participate in this conversation.