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

VanJr's avatar
Level 2

Laravel 8: Jetstream; Livewire; Inertia error

I just performed a fresh installation of Laravel 8.0.0 and I am following the DOCs to get a login/registration page. I executed these two commands successfully

composer require laravel/jetstream

php artisan jetstream:install livewire/inertia

but I am getting this error:

Error
Class 'Inertia\Inertia' not found
http://127.0.0.1:8000/

Laravel\Jetstream\Http\Middleware\ShareInertiaData::handle
vendor/laravel/jetstream/src/Http/Middleware/ShareInertiaData.php:23

Did I miss a step?

0 likes
11 replies
rjvds's avatar

php artisan jetstream:install intertia (inertia or livewire, not both!) npm install npm run dev

Snapey's avatar

The docs are unclear. You need to make a choice livewire OR inertia

1 like
harmeet's avatar

@Snapey Livewire is for the blade.php template and inertia is used for vue.js

monstajamss's avatar

I had this same problem i had to create new project by using laravel new blog --jet

monstajamss's avatar

Or you can do composer require inertiajs/inertia-laravel it should solve it.

1 like
janmoes's avatar

I also had that problem, making a new test project now. What is the preffered choice Inertiajs or livewire?

Snapey's avatar

I had a PR accepted to change the docs. They are now clear that you run one command or the other.

2 likes
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.