Filament V3 with webpack

Is Filament v3 still compatible with Webpack? I'm trying to update the project and create a new custom theme for Media Library Pro and I receive an error: Typed property Filament\Support\Assets\Asset::$package must not be accessed before initialization This is what i have in webpack.mix.js:
.postCss('resources/css/filament/admin/theme.css', 'assets/css', [
require('tailwindcss')
])
.postCss('resources/css/filament/admin/theme.css', 'assets/css', [
require('tailwindcss')
])
and this is what i have in AdminServiceProvider.php:
return $panel
->theme('resources/css/filament/admin/theme.css')
->default()
->id('admin')
->path('admin')
->login()
->authGuard(env('FILAMENT_AUTH_GUARD', 'admin'))
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
return $panel
->theme('resources/css/filament/admin/theme.css')
->default()
->id('admin')
->path('admin')
->login()
->authGuard(env('FILAMENT_AUTH_GUARD', 'admin'))
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
4 Replies
Dennis Koch
Dennis Koch14mo ago
->theme() should refer to the output file Please also read #✅┊rules . Share the error and format your code.
RoxanaAnghel
RoxanaAnghelOP14mo ago
@Dennis Koch Thanks for the response. I've changed the paths and i'm receiveing the same issue. In webpack.mix.js i have:
.postCss(
'resources/css/filament/admin/theme.css',
'assets/css/filament/filament/app.css',
[require('tailwindcss')]
)
.postCss(
'resources/css/filament/admin/theme.css',
'assets/css/filament/filament/app.css',
[require('tailwindcss')]
)
and in AdminPanelProvider.php:
->theme('assets/css/filament/filament/app.css')
->theme('assets/css/filament/filament/app.css')
https://flareapp.io/share/Bm0Y1qJP
Flare
Typed property Filament\Support\Assets\Asset::$package must not be accessed before initialization - The error occurred at https://luxgive.graffino.dev/admin
Dennis Koch
Dennis Koch14mo ago
Hm, no idea why it is looking for $package for standard Filament, or why it's not defined as filament. Did you clear your caches using artisan filament:upgrade after the last update?
RoxanaAnghel
RoxanaAnghelOP14mo ago
Yes
Want results from more Discord servers?
Add your server