Skip to content

Uncaught (in promise) Component not found (V3) #7137

Answered by Muffinman
Muffinman asked this question in 5. Bugs
Discussion options

You must be logged in to vote

OK I found the issue, and it was my fault for not reading the docs thoroughly enough.

The wire:key has to be on the root element DIRECTLY inside the foreach loop. From the docs:

When looping through data in a Livewire template using @foreach, you must add a unique wire:key attribute to the root element rendered by the loop.

https://livewire.laravel.com/docs/components#adding-wirekey-to-foreach-loops

What is not clear from the docs is that if you have a CSS grid it seems you need to do something like:

<div class="grid grid-cols-12">
    @foreach ($items as $item)
        <div class="col-span-3" wire:key="title-{{ $item->id }}">{{ $item->title }}</div>
        <div class="col-span-3" wire…

Replies: 6 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@lrljoe
Comment options

@Muffinman
Comment options

@lrljoe
Comment options

Comment options

You must be logged in to vote
1 reply
@Muffinman
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Muffinman
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants