masmerise / livewire-toaster

Beautiful toast notifications for Laravel / Livewire.
MIT License
342 stars 22 forks source link

Uncaught ReferenceError: toasterHub is not defined #12

Closed dev closed 1 year ago

dev commented 1 year ago

Everything works great, but for some reason I'm getting this error on page load: Screenshot 2023-07-07 at 10 29 26

app.blade.php: Screenshot 2023-07-07 at 10 30 28

Tailwind.config.js: Screenshot 2023-07-07 at 10 30 48

app.js: Screenshot 2023-07-07 at 10 35 36

Laravel version: v10.10.1 Toaster version: 1.2.1 Livewire version: v2.12.3

mabdullahsari commented 1 year ago

You seem to be using Alpine from a CDN. That's not supported.

Please use Alpine through an NPM Module instead.

Altffenser commented 10 months ago

I am going through the same situation, the difference of this case to mine is that I have Alpine installed from NPM and I still get these errors... anyone who has had this happen and can help me a bit with this?

Laravel version: 10.8 PHP version: 8.2 Livewire version 2.12.6 Toaster version: 1.3

chatisk commented 9 months ago

Same here, any clue @mabdullahsari ?

Whats the AlpineJs requirement?

mabdullahsari commented 9 months ago

Same here, any clue @mabdullahsari ?

Whats the AlpineJs requirement?

Livewire 3 no longer requires you to pull in Alpine yourself. This error should no longer be possible with Toaster 2.

chatisk commented 9 months ago

Same here, any clue @mabdullahsari ?

Whats the AlpineJs requirement?

Livewire 3 no longer requires you to pull in Alpine yourself. This error should no longer be possible with Toaster 2.

Thank you for your immediate response. I was talking about the required version of alpine. I am using alpine V2 and this package , 1.3. I guess that's why I have issues.please include that in your md cause I switched to yours since it nowhere said that it needs alpine V3. Anyways, thanks again

mabdullahsari commented 9 months ago

Same here, any clue @mabdullahsari ? Whats the AlpineJs requirement?

Livewire 3 no longer requires you to pull in Alpine yourself. This error should no longer be possible with Toaster 2.

Thank you for your immediate response. I was talking about the required version of alpine. I am using alpine V2 and this package , 1.3. I guess that's why I have issues.please include that in your md cause I switched to yours since it nowhere said that it needs alpine V3. Anyways, thanks again

You should follow the Livewire 3 upgrade guide first. This package is not meant to be used as a standalone thing. It assumes you also use Livewire for other things.

Altffenser commented 9 months ago

Same here, any clue @mabdullahsari ?

Whats the AlpineJs requirement?

Livewire 3 no longer requires you to pull in Alpine yourself. This error should no longer be possible with Toaster 2.

Thank you for your immediate response. I was talking about the required version of alpine. I am using alpine V2 and this package , 1.3. I guess that's why I have issues.please include that in your md cause I switched to yours since it nowhere said that it needs alpine V3. Anyways, thanks again

Hello, I solved this defining as Alpine plugin