TypeError: Cannot convert undefined or null to object
how to fix it? if i click on action button, twice(create and edit) i got the error.
3 Replies
Share you action code.
i just updated my filament version from 3.0 to 3.2 with necessary assists and vendor files but still same problem , then i try with new fresh project with the version 3.2 .while i press edit or create button form is opened but in second attempt form did not open . <?php
namespace App\Filament\Resources;
use App\Filament\Resources\CustomerResource\Pages;
use App\Filament\Resources\CustomerResource\RelationManagers;
use App\Models\Customer;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class CustomerResource extends Resource
{
protected static ?string $model = Customer::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
public static function form(Form $form): Form
{
return $form
->schema([
//
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
//
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListCustomers::route('/'),
// 'create' => Pages\CreateCustomer::route('/create'),
// 'edit' => Pages\EditCustomer::route('/{record}/edit'),
];
}
}
The problem only comes when using modals.