Closed reihanboo closed 6 months ago
Hi, can you inspect the network tab and see how many toasts are being dispatched in the response payload? You should see them under the effects
key!
@mabdullahsari I'm seeing this too - double toasts when using redirect()->route('my.view', [...])->success('created!');
I'm also seeing console errors: Uncaught ReferenceError: toasterHub is not defined
@mabdullahsari I'm seeing this too - double toasts when using redirect()->route('my.view', [...])->success('created!');
I'm also seeing console errors: Uncaught ReferenceError: toasterHub is not defined
Hi, can you inspect the network tab and see how many toasts are being dispatched in the response payload? You should see them under the effects key!
Apologies, @mabdullahsari where is the effects key?
Apologies, @mabdullahsari where is the effects key?
You need to find the Livewire request (generally called update
) and look at the Response
tab. It should contain a payload similar to (but not exactly like) this:
I have sorted it I believe, Alpine/Livewire were being loaded twice.
I've removed the following from my resources/js/app.js:
import Alpine from 'alpinejs';
Alpine.start();
... and it now works! Single Toast and no Duplicate Alpine errors in console.
Thanks for your help @mabdullahsari, and @reihanboo I hope this is useful for you too.
I have sorted it I believe, Alpine/Livewire were being loaded twice.
I've removed the following from my resources/js/app.js:
import Alpine from 'alpinejs'; Alpine.start();
... and it now works! Single Toast and no Duplicate Alpine errors in console.
Thanks for your help @mabdullahsari, and @reihanboo I hope this is useful for you too.
I'm glad you got it sorted!
I did the installation tutorial. Here's some snippet: app.js
app.blade.php
toaster.php
is left unchanged, but I did publish it.tailwind.config.js
Here's how I'm using it. Though it happens everywhere, not just Livewire components.
Create.php