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

manojo123's avatar

Route:inertia() not working properly

I'm having this problem when I try to serve my app

UnexpectedValueException: Invalid route action: [App\Http\Controllers\Inertia\Controller]

Route.php

Route::middleware('auth')->group(function () {
    Route::inertia('/', 'Shop');
});

Can someone help me?

0 likes
2 replies
Nakov's avatar
Nakov
Best Answer
Level 73

Do you have a value for the $namespace in your RouteServiceProvider? Set it to empty string in case you use the default which is App/Http/Controller and make sure you use full path to the controllers in your routes.

And do you have a component named Shop?

1 like
manojo123's avatar

Commenting the namespace worked for me. Thanks for the help.

Please or to participate in this conversation.