laravel-notify icon indicating copy to clipboard operation
laravel-notify copied to clipboard

Livewire Maxium Call Stack Size

Open doubleprincez opened this issue 2 years ago • 5 comments

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

doubleprincez avatar Jul 09 '21 12:07 doubleprincez

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.

Jenkinsfeel avatar Jul 20 '21 22:07 Jenkinsfeel

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

abishekrsrikaanth avatar Oct 08 '21 16:10 abishekrsrikaanth

@Jenkinsfeel

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

@mckenziearts Please Look into it

abbasmashaddy72 avatar Aug 13 '22 04:08 abbasmashaddy72

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

@mckenziearts

abbasmashaddy72 avatar Aug 13 '22 04:08 abbasmashaddy72

Nice

jenkinsakp avatar Aug 15 '22 21:08 jenkinsakp

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>

krismanning avatar Oct 18 '22 22:10 krismanning