Error with Livewire after installation
Hi, just installed the package and was presented with this error upon clicking on a .log file in the panel on the left:
Livewire encountered corrupt data when trying to hydrate the [opcodes.log-viewer.http.livewire.log-list] component. Ensure that the [name, id, data] of the Livewire component wasn't tampered with between requests.
Does anyone have ideas on how to resolve?
This is a type of conversion problem.
Hey @CrazyBoy49z , can you elaborate? Would this have something to do with corrupt or non-UTF-8 log entries?
@mangrovestudios , is there any chance you can share the log file (full, not an excerpt) that you were trying to open? Then I can debug it as well.
I didn't catch this with this component, but it's mainly a problem with type changes in the liveware, for example in the form
class User ....
public ?string $name = null
or
public User $user
form
<input wire:model="name" ... />
or
<input wire:model="user.name" ... />
The user fills in the name field and receives an error
For some reason, the problem does not always arise, but only in individual cases
laravel-2022-08-23.log See log file attached - it's a daily file and the error occurred right away. Hope it helps!
Hey @mangrovestudios , I've tried this log file and it seems to be opening just fine:
Of course, that's on a fresh new project without any other dependencies that might be messing something up.
Is your project public? Then maybe I can debug in the exact environment you have to see what causes the crash.
Some custom middleware I have in my project must be altering the request.
So, as a workaround, I created a new middleware group with the Laravel defaults only, and assigned it in the config file. I also had to do the same in Livewire's config file so that those routes are going through the right middleware too.
And now it works :)