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

leonvr's avatar

Livewire encountered corrupt data when trying to hydrate the [invitation.send] component. Ensure that the [name, id, data] of the Livewire component wasn't tampered with between requests.

On mount of my livewire component send.php & send.blade.php:

 if (!$this->invitation->active) {
 	$this->activateLink = route('wishlists.invitations.edit-active', ['wishlist' => $this->invitation->wishlist_id, 'invitation' => $this->invitation->id]);
	$this->msg = __('This invitation is inactive. You may <u><a href=":link">activate</a></u> it first.', ['link' => $this->activateLink]);
}

This works fine when the component mounts. $msg is shown correctly within blade template.

But when I execute another livewire-request by clicking a button on the page, I get the following error. Anyone know the solution for this?

Livewire encountered corrupt data when trying to hydrate the [invitation.send] component. Ensure that the [name, id, data] of the Livewire component wasn't tampered with between requests.

0 likes
14 replies
leonvr's avatar
leonvr
OP
Best Answer
Level 2

I still do not fully understand, but it has to do with the domain name. It might help somebody: the error occurs when I run using npm run watch, which opens localhost:3000, while the default test domain is mytestdomain.test. If I run using mytestdomain.test the error does not occur.

1 like
chaudigv's avatar

Check your .env APP_URL=mytestdomain.test. Try to change it to localhost:3000 and see if it helps.

leonvr's avatar

Makes no difference. I will stick to mytestdomain.test

bobwurtz's avatar

@leonvr Were you able to solve this? I have no issues locally or in staging but my production environment just started throwing this error. It started happening seemingly at random (I had not pushed any changes to the code - it was working at the start of the day and then all of a sudden started throwing an error). I tried updating Livewire and adding a unique wire:key to a couple different elements but no luck.

leonvr's avatar

I did not solve this, just avoided the error. My app is not yet in production, so no experience there. In my case it had to do with not consistently using the same domainname throughout my app (because I used npm run watch, which uses localhost vs. mytestdomain.test). You could check that 'url' in your config/app.php is pointing to the 'APP_URL' in your .env in production. And that this APP_URL is set to the correct domain name. And that you are not using another domainname somewhere in your code.

vlchris's avatar

I'd like to throw my .02 in here for anyone that runs into it. If you are trying to store raw objects (say from an API call you just made) into a public property in livewire you will get this issue.

Your best bet is to turn your object returned from an API call into an array.. something like a:

public array $lwProperty;

$this->lwProperty = json_decode(json_encode($apiResult),true);

It seems LW can't handle nested objects in an array returned from something like an API call. Hope this helps someone because it drove me insane.

8 likes
raimondsL's avatar

Happened to me, because my blade view was N+1 loading "supplier->name's", which resulted in "modified data", because relationship object was added to the parent object. So depending on the situation, the workaround may differ...

Phread's avatar

I encountered this error when I had a field defined to the wrong datatype. Once I changed it to the correct datatype the hydrate error went away.

Please or to participate in this conversation.