Stand-alone Filament pages throwing 'component not found' exception on form submit

Hi all I'm trying to create some independent pages that extend SimplePage and route directly to them using Route::get('/test-page', TestPage::class)->name('test-page');. I'm running into a Livewire ComponentNotFoundException when I try to submit the form. Could someone help? Are there any know issues with routing directly to Filament pages? Here's my code:
<?php

declare(strict_types=1);

namespace Modules\Filament\Pages;

use Filament\Actions\Action;
use Filament\Pages\SimplePage;
use Filament\Forms\Components\TextInput;
use Filament\Pages\Concerns\InteractsWithFormActions;

class TestPage extends SimplePage
{
use InteractsWithFormActions;

protected static string $view = 'filament-module::test-page';
protected ?string $heading = 'Test page';

public function testMethod(): void
{
dd('Success!');
}

protected function getFormSchema(): array
{
return [
TextInput::make('test')
->label('Test')
->required()
->autofocus(),
];
}

protected function getFormActions(): array
{
return [
Action::make('test')
->label('Test')
->submit('testMethod'),
];
}
}
<?php

declare(strict_types=1);

namespace Modules\Filament\Pages;

use Filament\Actions\Action;
use Filament\Pages\SimplePage;
use Filament\Forms\Components\TextInput;
use Filament\Pages\Concerns\InteractsWithFormActions;

class TestPage extends SimplePage
{
use InteractsWithFormActions;

protected static string $view = 'filament-module::test-page';
protected ?string $heading = 'Test page';

public function testMethod(): void
{
dd('Success!');
}

protected function getFormSchema(): array
{
return [
TextInput::make('test')
->label('Test')
->required()
->autofocus(),
];
}

protected function getFormActions(): array
{
return [
Action::make('test')
->label('Test')
->submit('testMethod'),
];
}
}
and the view:
<x-filament-panels::page.simple>
<x-filament-panels::form wire:submit="testMethod">
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page.simple>
<x-filament-panels::page.simple>
<x-filament-panels::form wire:submit="testMethod">
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page.simple>
When I submit the form, the component namespace that's returned with the exception is different to the one I've specified in the class. I'm getting Unable to find component: [modules.filament.pages.test-page]. But the correct view (filament-module::test-page) is being rendered correctly when the page loads. Not sure what's going on.
Solution:
Never mind, it was a component registration issue.
Jump to solution
1 Reply
Solution
binaryfire
binaryfire14mo ago
Never mind, it was a component registration issue.
Want results from more Discord servers?
Add your server