This is a classic gotcha with Blaze. Your footer-admin works fine because it's likely just static HTML, but your sidebar is tripping up the compiler.
Blaze is primarily designed as a drop-in replacement for anonymous, stateless components. Sidebars almost always break this rule in one of two ways:
Never pass your root views/components directory into Blaze. You only want to optimize "dumb", presentational UI components (buttons, badges, icons, cards, footers).
Update your AppServiceProvider to specifically target directories that don't rely on global state or backing classes:
public function boot(): void
{
// Target specific UI folders instead of everything
Blaze::optimize()
->in(resource_path('views/components/ui'))
->in(resource_path('views/components/icons'))
->in(resource_path('views/components/footers'));
}
Exclude complex structural components like navbars and sidebars from Blaze entirely and you'll be good to go.