In dynamic applications using Livewire, where elements in the DOM can be updated or replaced, calling the dispose method on a Toast instance sometimes results in an Uncaught TypeError: Cannot read properties of null (reading 'addEventListener'). This occurs when this.$el is null or undefined, which can happen if the DOM element associated with the Toast has been removed or replaced by Livewire before dispose is called.
In dynamic applications using Livewire, where elements in the DOM can be updated or replaced, calling the
dispose
method on aToast
instance sometimes results in anUncaught TypeError: Cannot read properties of null (reading 'addEventListener')
. This occurs whenthis.$el
is null or undefined, which can happen if the DOM element associated with the Toast has been removed or replaced by Livewire beforedispose
is called.