Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

username1's avatar

Class 'Inertia\Inertia' not found

good day, Im having this error when i install php artisan jetstream:install livewire, I don't knw why im getting this error, im not running or installing inertia only livewire. please help help. im new in livewire, this is the error! C:\Users\User\Documents\Laravel 8 Training\livewire folder\hms-admin-livewire\vendor\laravel\jetstream\src\Http\Middleware\ShareInertiaData.php:22

This is from shareInertiaData.php namespace Laravel\Jetstream\Http\Middleware;

use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Session; use Inertia\Inertia; use Laravel\Fortify\Features; use Laravel\Jetstream\Jetstream;

class ShareInertiaData { /** * Handle the incoming request. * * @param \Illuminate\Http\Request $request * @param callable $next * @return \Illuminate\Http\Response */ public function handle($request, $next) { Inertia::share(array_filter([ 'jetstream' => function () use ($request) { return [

This is from config jetstream 'stack' => 'inertia',

0 likes
6 replies
username1's avatar

This is from config jetstream .. 'stack' => 'inertia',

1 like
Sinnbeck's avatar

@username1 make you you don't have inertia in composer.json. If you do, remove that line.

Now delete the vendor folder, and run composer update

2 likes
Sinnbeck's avatar

@username1 Happy to help. Remember to mark a best answer to set the thread as solved.

1 like
monavb's avatar

@username1 If you have installed Jetstream and not using it / removed the changes but you need to remove Jetstream using composer remove laravel/jetstream

1 like
rahmanpoor's avatar

Note that this path does not recognize Inertia class. vendor/laravel/jetstream/src/Http/Middleware/ShareInertiaData.php:23

You should add this class by this command: composer require inertiajs/inertia-laravel

The problem will be solved and enjoy.

Please or to participate in this conversation.