log-viewer icon indicating copy to clipboard operation
log-viewer copied to clipboard

Error with Livewire after installation

Open mangrovestudios opened this issue 3 years ago • 5 comments

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?

mangrovestudios avatar Aug 22 '22 12:08 mangrovestudios

This is a type of conversion problem.

CrazyBoy49z avatar Aug 22 '22 19:08 CrazyBoy49z

Hey @CrazyBoy49z , can you elaborate? Would this have something to do with corrupt or non-UTF-8 log entries?

arukompas avatar Aug 23 '22 05:08 arukompas

@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.

arukompas avatar Aug 23 '22 05:08 arukompas

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

CrazyBoy49z avatar Aug 23 '22 05:08 CrazyBoy49z

laravel-2022-08-23.log See log file attached - it's a daily file and the error occurred right away. Hope it helps!

mangrovestudios avatar Aug 23 '22 08:08 mangrovestudios

Hey @mangrovestudios , I've tried this log file and it seems to be opening just fine:

Screenshot 2022-08-24 at 07 59 05

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.

arukompas avatar Aug 24 '22 05:08 arukompas

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 :)

mangrovestudios avatar Aug 24 '22 09:08 mangrovestudios