Level 58
Well, it looks like you've stumbled upon a tricky problem! The answer is simple: you should set the return type to Illuminate\Http\InertiaResponse! That should do the trick.
Happy coding!
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
public function index(): Response
{
return inertia('Tags/Index');
}
//ERROR 'expecting 'illuminate\Http\Response'
//ERROR 'expecting 'illuminate\Http\Response'
If I remove the : Response it works.
What return type should we set for inertia?
You can use it like this.
public function index(): Response
{
return response()->inertia('Tags/Index');
}
public function index(): View
{
return inertia('Tags/Index');
}
Please or to participate in this conversation.