F
Filament2mo ago
br1

Filament v4 migration: Livewire SupportValidation breaks with global dont-discover

Hi everyone, I’m migrating a project from Filament v3 to v4 and I’ve run into an issue when disabling Laravel package discovery. Environment: Laravel 12.31.1 (migrated from 11) Filament 3.2.117 → 4.x migration Livewire 3.5.6 -> 3.6.4 Here’s the situation: With default package discovery, everything works fine. But when I disable discovery globally in composer.json:
"extra": {
"laravel": {
"dont-discover": [
"*"
]
}
}
"extra": {
"laravel": {
"dont-discover": [
"*"
]
}
}
…and then manually register Filament, Livewire, and related providers inside config/app.php, I immediately hit this error after a component hook runs:
Illuminate\Support\ViewErrorBag::put(): Argument #2 ($bag) must be of type
Illuminate\Contracts\Support\MessageBag, null given,
called in /app/vendor/livewire/livewire/src/Features/SupportValidation/SupportValidation.php on line 21
Illuminate\Support\ViewErrorBag::put(): Argument #2 ($bag) must be of type
Illuminate\Contracts\Support\MessageBag, null given,
called in /app/vendor/livewire/livewire/src/Features/SupportValidation/SupportValidation.php on line 21
This looks like the error bag is being accessed before the component is fully hydrated. The strange part is that this exact setup worked fine in Filament v3, and only fails now after the upgrade to v4 with discovery disabled. - Has anyone experienced this issue before when migrating to Filament v4 with package discovery disabled? - Is there a recommended way to manually bootstrap Filament and Livewire so that all component hooks and validation features work correctly while keeping global package discovery disabled? Any tips on initialization order or required providers would be greatly appreciated. Thanks a lot for any insights!
Solution:
Make sure that all of filament’s providers are loaded before the livewire provider.
Jump to solution
2 Replies
Solution
awcodes
awcodes2mo ago
Make sure that all of filament’s providers are loaded before the livewire provider.
br1
br1OP2mo ago
It worked, thank you!

Did you find this page helpful?