mckenziearts / laravel-notify

Flexible Flash notifications for Laravel
Other
1.62k stars 189 forks source link

Livewire Maxium Call Stack Size #68

Closed doubleprincez closed 1 year ago

doubleprincez commented 3 years ago

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
Jenkinsfeel commented 3 years ago

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.

abishekrsrikaanth commented 2 years ago

@mckenziearts any updates on this? Can't seem to use this package on TALL stack

abbasmashaddy72 commented 2 years ago

@Jenkinsfeel

This issue occurs in Laravel 9, Alpine 3, Tailwind 3, Livewire 2

@mckenziearts Please Look into it

abbasmashaddy72 commented 2 years ago

Just Update your Package Alpine JS to 3 it will be fixed

@mckenziearts

jenkinsakp commented 2 years ago

Nice

krismanning commented 1 year ago

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>