usernotnull / tall-toasts

A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS 🔥🚀
MIT License
541 stars 32 forks source link

Unable to call component method. Public method [data] not found on component #451

Closed BrekiTomasson closed 10 months ago

BrekiTomasson commented 10 months ago

Description

Getting the above error using the latest versions of Livewire and AlpineJS. The error disappears when I remove <livewire:toasts /> from my app.blade.php file.

To Reproduce

  1. Install latest AlpineJS and Livewire
  2. Install latest tall-toasts
  3. add <livewire:toasts /> to top of <body> tag

Expected behavior

It should not fail.

BrekiTomasson commented 10 months ago

Never mind, it turns out I was loading the plugin in the wrong way, using the old syntax Alpine.data('ToastComponent', ToastComponent) - it works when loading it the proper way. My bad.