Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

devSSI's avatar

Laravel Livewire does not work properly

Hello, can someone guide me through the issue with laravel livewire v2.

I get this message in the console when I load the component and reload the page: https://prnt.sc/SBxT91yu2JTR

Now this is the code from my blade component

<div>
    <button type="button" wire:click="triggerCustomMethod">Trigger</button>
</div>

And this is the class code

    public function triggerCustomMethod()
    {
        dd('I am here');
    }

What is going on? :D

0 likes
6 replies
aisuvro's avatar

More information is needed. Initially, it seems like the livewire installation is not correct.

devSSI's avatar

@aisuvro That is all I had :D That is why I am stuck. Regarding the livewire isntallation, it was basic one then I removed it and followed docs and still the same issue.

aisuvro's avatar

@devSSI I need the complete screenshot of your code. The livewire class file, the livewire blade file, and the file where you have included the livewire snippet.

devSSI's avatar

@JabatoForever nah, I test my methods like that :D If it worked it should have hit method and inside of the method it should dump me some data :)

1 like
jigar_dhulla's avatar

In the network tab:

  1. Check the complete response <!DOCTYPE..... Clearly, it is rendering a HTML instead of JSON. Try to decode what that webpage actually is, you should be able to proceed further then. For e.g. it can a login screen.
  2. If you are still stuck, give us the route and complete HTML response that is throwing this error.

In my experience, modifications to middleware group web can cause some issue.

Please or to participate in this conversation.