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

YY1's avatar
Level 2

caught Snapshot missing on Livewire component with id:

When i click those buttons

{{-- Filter by Gender --}} @if (!$hideGenderFilter) šŸ” Filter by Gender

                    <button wire:click="setGender('female')"
                            class="flex-1 px-4 py-2 rounded-lg text-sm hover:bg-secondary hover:text-foreground focus:outline-none @if ($gender == 'female') bg-pink-500 text-white @else text-foreground @endif">šŸ‘© Women</button>
                    <button wire:click="setGender('male')"
                            class="flex-1 px-4 py-2 rounded-lg text-sm hover:bg-secondary hover:text-foreground focus:outline-none @if ($gender == 'male') bg-blue-500 text-white @else text-foreground @endif">šŸ‘Ø Men</button>
                </div>
            </div>
        @endif

i get this error "caught Snapshot missing on Livewire component with id:" and after that "Uncaught Component not found"

0 likes
7 replies
Chingy's avatar

Sounds like a dom diffing issue, but without the whole component, we can only make assumptions. Is this a nested component? Do you have wire:keys ? Have you included your @if inside a DIV element ?

YY1's avatar
Level 2

I am including my component here

and the component content is wrapped arount a div

And yeah i have a wire keys. But on the buttons i don't have wire keys but every foreach have them.

Chingy's avatar

@Yordan1948 Are you able to provide the code of the component?

Instead of doing @ifs try entangling your boolean to an alpine property, and then do x-show. Does the problem still persist?

1 like
Chingy's avatar

@Yordan1948 I didnt say your component inside DIVs. I said your @ifs inside a div. your @if is adding DOM content that Livewire wouldn't otherwise expect to append to that point. Enclosing your @if statements with div, makes it easier for livewire to append the DOM content you want without everything going "f**k all"

Please or to participate in this conversation.