Class "Vite" not found PHP 8.1.9 Laravel 9.27.0 after the update, such an error appeared when trying to use the Vite::asset method in blade templates. Vitek is working, everything is fine. Please help me with advice on what to do?
Can you show the code that is throwing the error?
@Sinnbeck
<img src="{{ Vite::asset('resources/assets/media/images/default.png') }}"> file home.blade.php
@AleksandrP I cannot recreate the error with the same version of laravel. Can you try php artisan optimize:clear and composer update?
resolved. I forgot to update the file config/app.php
@Sinnbeck
add use Illuminate\Support\Facades\Facade;
add:
'aliases' => Facade::defaultAliases()->merge([
// 'ExampleClass' => App\Example\ExampleClass::class,
])->toArray(),
Just adding 'Vite' => Illuminate\Support\Facades\Vite::class, to the array of class aliases will suffice.
Please sign in or create an account to participate in this conversation.