Livewire encountered corrupt data when trying to hydrate a component.

Getting this error when trying to submit a specific form action in production. I get no errors when running locally. Livewire encountered corrupt data when trying to hydrate a component. Ensure that the [name, id, data] of the Livewire component wasn't tampered with between requests. The stack trace is entirely vendor files, so I don't really know where to begin debugging this.
5 Replies
36864
36864OP4w ago
Form:
->form([
TextInput::make('mobile_number')
->label(__('Mobile Number'))
->formatStateUsing(fn($state) => $state ? $state : $infolist->getRecord()->client->mobile)
->required(),
TextInput::make('amount')
->label(__('Amount'))
->numeric()
->minValue(1)
->formatStateUsing(fn($state) => $state ? $state : -$infolist->getRecord()->client->balance)
->required(),
TextInput::make('message')
->label(__('Message')),
->form([
TextInput::make('mobile_number')
->label(__('Mobile Number'))
->formatStateUsing(fn($state) => $state ? $state : $infolist->getRecord()->client->mobile)
->required(),
TextInput::make('amount')
->label(__('Amount'))
->numeric()
->minValue(1)
->formatStateUsing(fn($state) => $state ? $state : -$infolist->getRecord()->client->balance)
->required(),
TextInput::make('message')
->label(__('Message')),
This apparently only happens when trying to submit the form on specific resources, not all of them.
Matthew
Matthew4w ago
Have you got middleware that is stripping tags or something similar? That can cause that issue.
36864
36864OP4w ago
No, and definitely no middleware that would only execute on accessing specific resources
Matthew
Matthew4w ago
Sorry, I'm out of ideas there then, When I had the same issue, it was anything working with HtmlStrings, as I had left some laravel stadard sanitisation middleware in.
36864
36864OP4w ago
I've finally managed to reproduce locally. It appears to only happen when the client's balance is equal to 0. Apparently it doesn't like to parse negative 0. Working around that fixes the issue. Thanks for looking into this!

Did you find this page helpful?