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 <?php...
Jump to solution
2 Replies
Solution
toeknee
toeknee4w ago
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,
]
Sjoerd24
Sjoerd24OP4w ago
That fixed my problem, thanks!!

Did you find this page helpful?