Livewire\Exceptions\ComponentNotFoundException issue
I am facing an error i.e. Unable to find component: [app.filament.resources.appraisal-response-resource.pages.appraisal-response-request] . This error is occurring when the page is loading for the first time, when refreshing the page, when i try to update any field and when I click on the save button. Please help me to solve this issue. Thank you.
9 Replies
I am also facing the same issue i.e Livewire\Exceptions\ComponentNotFoundException issue
so how to solve it ??
If your livewire component isn’t in the Livewire directory it can’t be discovered automatically so you need to manually register it in a service provider.
Thank you for your response.
It is not a custom Livewire component; it is a custom resource page that extends from EditRecord. In version 2, it was working perfectly, but in version 3, I am encountering the error mentioned above.
Hello there, I'm still facing the issue mentioned earlier with the custom resource page in v3. Any insights or suggestions on how to resolve it would be greatly appreciated. Thank you.
This is my File Structure
and Here AppraisalResponseRequest is my custom Resource Page that extends From EditRecord
and the right side picture is my blade file structure
and i got below error
Livewire\Exceptions\ComponentNotFoundException
Unable to find component: [app.filament.resources.appraisal-response-resource.pages.appraisal-response-request]
Your view is not in the right place. Either move it to the directory path mentioned in the error. Or change the path in your AppraisalResponseRequest class.
Thank you for your response..
"I have tried applying the above-mentioned approach as you suggested, but it's not working. I am currently in the process of upgrading from v2 to v3. In v2, the folder structure is similar to the one in the above picture, and it works perfectly. However, in v3, when I try to update the value, it gives the error mentioned above."
please suggest me an example of the file structure and view structure for a custom resource page that extends from editrecord. This will help me a lot.
Thank you...
That dot syntax string in the error is the structure. Replace the dots with slashes.
Or just assign a different path for the $view in your resource class.
This is basic laravel view convention.
This is a custom resource page that extends from EditRecord. The EditRecord already has a view. I want to make changes to only the layout part, as shown in the picture above. Additionally, I've followed the file structure you mentioned, but it's not working as expected.
And this is my ApprisalResponseRequest Code (Custom Resource Page) :
class AppraisalResponseRequest extends EditRecord
{
protected static string $resource = AppraisalResponseResource::class;
protected static string $layout = 'components.appraisal-response-request.layouts.index';
protected function authorizeAccess(): void
{
}
public function mount(int | string $record = null): void
{
try {
$data = JWT::decode(app('request')->input('token'), ['header' => true]);
} catch (\Throwable $th) {
abort(403);
}
$appraisal_response = AppraisalResponse::where([['id', $data['response_id']], ['status', AppraisalResponseStatus::DRAFT]])->first();
if (!$appraisal_response) {
abort(404);
}
parent::mount($appraisal_response->id);
}
protected function getHeaderActions(): array
{
return [
//
];
}
protected function afterSave(): void
{
$this->record->status = AppraisalResponseStatus::SUBMITTED();
$this->record->save();
}
public function form(Form $form): Form
{
$form = static::$resource::form($form, true);
return $form;
}
}
Could someone please assist me in fixing this issue? I also changed the file structure, but it's not working.
and i got below error
Livewire\Exceptions\ComponentNotFoundException
Unable to find component: [app.filament.resources.appraisal-response-resource.pages.appraisal-response-request]