livewire-powergrid: [Bug]: When using blade header component, I get "Livewire encountered corrupt data" Error

Have you searched through other issues to see if your problem is already reported or has been fixed?

Yes, I did not find it.

Did you read the documentation?

Yes, I did not find it.

Have you tried to publish the views?

Yes - I didn’t work.

Is there an error in the console?

No

PHP Version

8.1

PowerGrid

^4.8

Laravel

v10.17.1

Livewire

v2.12.5

Alpine JS

3.x.x

Theme

Bootstrap

Describe the bug.

I am using blade components in row action and header action, both the button has two different modals which pop up, when I click on the action button of the modal I get this error “Livewire encountered corrupt data when trying to hydrate the [admin.back-office-user.back-office-user-listing-table] component. Ensure that the [name, id, data] of the Livewire component wasn’t tampered with between requests.”


    public function actions(): array
    {
        return [
            Button::add('deleteButton')
                ->bladeComponent('delete_button', ['id' => 'id', 'name' => 'name']),
        ];
    }

    public function delete($id)
    {
        $result = BackOfficeUser::findOrFail($id)->delete();

        if ($result) {
            session()->flash('success', 'Back Office User Deleted Successfully!');
        } else {
            session()->flash('error', 'Database Error Occurred!');
        }

        return redirect(route('backOfficeUser.show'));
    }

    public function header(): array
    {
        return [
            Button::add('bulkDelete')
                ->bladeComponent('bulk_delete_button', ['name' => 'test']),
        ];
    }
    
    public function bulkDelete()
    {
        dd('test');
    }

if I remove the header button, everything works fine. How can i resolve this error?

To Reproduce…

First click on “FOO” then…

Extra information

<?php
 //...

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 30 (22 by maintainers)

Most upvoted comments

test again and let me know. thank you

Hey @luanfreitasdev ! Thank you so much for your help! Everything is work perfectly!

test again and let me know. thank you

In livewire, this happens when requests change during a request.