© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•14mo ago•
3 replies
Sjoerd24

Strange php artisan optimize error

Hi there, so when i use this command on forge:
php artisan optimize

I get this error:
INFO Caching framework bootstrap, configuration, and metadata.

config ........................................................ 58.73ms DONE
events ......................................................... 2.00ms DONE
routes ........................................................ 85.83ms DONE
views ........................................................ 799.51ms FAIL

In ComponentTagCompiler.php line 316:

[InvalidArgumentException]
Unable to locate a class or view for component [heroicon-s-clipboard-document].

The strange this is, i don't get this error on my local server. I searched my codebase for this icon and it is only used my the breezy plugin that I am using. Anyone has any idea how to fix this? (i already use artisan filament:cache-components, but I think artisan optimize does more general laravel caching right?)
Solution
I had these recently, add this service provider:


<?php

namespace App\Providers;

use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

class IconsServiceProvider extends ServiceProvider
{
    public function register()
    {
        //
    }

    public function boot()
    {
        Blade::anonymousComponentPath(__DIR__.'/../../vendor/blade-ui-kit/blade-heroicons/resources/svg', 'heroicon');
    }
}
<?php

namespace App\Providers;

use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

class IconsServiceProvider extends ServiceProvider
{
    public function register()
    {
        //
    }

    public function boot()
    {
        Blade::anonymousComponentPath(__DIR__.'/../../vendor/blade-ui-kit/blade-heroicons/resources/svg', 'heroicon');
    }
}


Then add it to the top of

    'providers' => [
        App\Providers\IconsServiceProvider::class,
]
    'providers' => [
        App\Providers\IconsServiceProvider::class,
]
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

every php artisan command throws error
FilamentFFilament / ❓┊help
3y ago
php artisan storage:link
FilamentFFilament / ❓┊help
2y ago
issue when php artisan migrate?
FilamentFFilament / ❓┊help
2y ago
php artisan make:filament-user
FilamentFFilament / ❓┊help
2y ago