laravel-notify
laravel-notify copied to clipboard
Livewire Maxium Call Stack Size
I get the error below when i imported notifyjs after livewire i.e
@livewireScripts
@notifyJs
dispatch.js:6 Uncaught RangeError: Maximum call stack size exceeded.
at dispatch (dispatch.js:6)
at Livewire.value (index.js:87)
at (index):1773
at dispatch (app.js:1798)
at Object.start (app.js:1853)
at notify.js:1
at (index):1765
at dispatch (dispatch.js:6)
at Livewire.value (index.js:87)
at (index):1773
but if you add it before it you get this message instead
(index):1682 Livewire: It looks like AlpineJS has already been loaded. Make sure Livewire's scripts are loaded before Alpine.\n\n Reference docs for more info: http://laravel-livewire.com/docs/alpine-js
None of the messages are displaying after installation. Am using Laravel 8.0 and with livewire installed. notify()->success('Laravel Notify is awesome!'), and others are not working on my project.
@mckenziearts any updates on this? Can't seem to use this package on TALL stack
@Jenkinsfeel
This issue occurs in Laravel 9, Alpine 3, Tailwind 3, Livewire 2
@mckenziearts Please Look into it
Just Update your Package Alpine JS to 3 it will be fixed
@mckenziearts
Nice
The only way I could stop this happening was to remove @notifyJs. After that everything worked fine. The only thing that broke was the notification autoclose. the notification now stays on the screen until I manually close it.
It seems that @notifyJS loads alpine. So does Livewire.
Im using latest Laravel 9, Livewire 2, tailwind 3, AlpineJS 3
To get the notification timeout working again I replaced @notifyJs with the following...
<script type="text/javascript">
e = document.querySelector("div.notify");
if(e) {
setTimeout(function(){ e.style.display = 'none'}, 5000);
}
</script>