jantinnerezo / livewire-alert

SweetAlert2 wrapper for Livewire
https://livewire-alert.jantinnerezo.com
MIT License
682 stars 73 forks source link

Defer loading scripts #137

Closed jigar-dhulla closed 5 months ago

jigar-dhulla commented 7 months ago

As Swal is external dependency, when Swal is loaded via vite bundler, it is deferred. Hence when using flash feature, we get error Uncaught (in promise) ReferenceError: Swal is not defined. This is because script inside flash is not deferred, adding type="module" to the <script> fixes that.

madurapa commented 6 months ago

I can confirm this PR fixes the particular issue.

madurapa commented 5 months ago

@jantinnerezo can you please check this out and merge?

madurapa commented 5 months ago

@jantinnerezo Can you do a new release as well with this PR to get via composer?

madurapa commented 4 months ago

Update the composer.json with "jantinnerezo/livewire-alert": "dev-master" insteard of "jantinnerezo/livewire-alert": "^3.0" then run composer update to fix the issue until this PR been released.