Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization #21
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
php
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pxlrbt/filament-activity-log#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I encountered the error "Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization"
while using Filament v3.0-stable and PHP 8.1.
Sorry, it's impossible to debug this without any code. What's the form schema for this?
That's the User model. Can you please share the form of your UserResource?
class UserResource extends Resource
{
protected static ?string $model = User::class;
}
same here, using filament v2
I'm getting that same error; it only happens when the data on the change is an object. If it's an empty array, the page loads.
The top one fails, and the page loads with the bottom one

It's not related to the data but to the form structure. It tries to get the name from the components and fails while accessing one of them. I guess it's a Section or Repeater or similar
Hey @pxlrbt .
I also have the same problem and I can share a very minimalist sequence of steps to reproduce the problem.
Let's assume a UserResource with at least 2 textinput ( 'email' and 'name') and ListUserActivities are in place.
I hope this helps in resolving the issue, or at least pointing out steps for accurately reproducing the error.
I have the same error in v3
Hi, I was checking the @fcno theory, then I made a test, I'm using the plugin https://filamentphp.com/plugins/bezhansalleh-shield for roles, so I've changed
CheckboxListcomponent toSelectcomponent, then it works.So maybe the problem is in the Form components configuration or construction.
Same problem here, I've got a Section in my form and some dependent fields. Doesn't work at all.
@pxlrbt It seems that this problem has gone away. I think that some update to the filament core ended up reflexively correcting the problem here.
I'm currently using version 3.2.17 of filament.
As this part of my code was commented out for a long time, I can't say which version of the filament ended up correcting the problem.
@Ray-vV Can u share your code and the filament version? try to use the latest version to see if the problem is gone.
Hm, interesting. I think there might still be issues with Sections or other Layout fields 🤔
Thanks for the suggestion, I decided to switch to the z3d0x/filament-logger for now. Not necesarrily due to this error however. But it turned out the z3d0x package was already more in the direction of what I wanted to implement into my project.
I could do some testing on a seperate branch with this package if that aids you guys in any way.
Unfortunately the problem is still here. And yes, changing CheckboxList to Select solves the problem.
Same. Sorry.
I had similar problem, so i fixed it by this code (I overwrite createFieldLabelMap method):
Same issue, I had to change to CheckboxList to Select, this solves it. thanks @nikosid for the tip !
@medaminebt Can you check whether the code from GORGDEVELOPER fixes it, too?
I just tried this with a CheckboxList and didn't have any issues. Is this still a problem? Filament v5 and v3.1 of the plugin.