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

asdasdsa's avatar

All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.

Hi

Trying to deploy Laravel with inertiajs with server side rendering. But i get the following error:

All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.

I have searched and searched, asked chatgpt numeroes times. But with no luck.

My links looks like this:

<Link :href="route('welcome')" class="me-4 hover:underline md:me-6">
Annonser
</Link>

ofc, i have import { Link } from '@inertiajs/vue3'; in the vue file.

And ofc in the route file i use return Inertia::render('Welcome', [

I have tcpdump'ed port 13714, and on the first request i can see som traffic. but when i then want to navigate the page, no action on the port, just that error message.

i have the x-inertia header. Have check mulipel times with various methods.

The strange part

When change my nginx configuration so that my default configuration (hitting IP xxx.xxx.xxx.xxx) points to the laravel/public, not the host name (example.com). The links work as expected!???!?

Can it be a hostname error somewhere, that the documentation doesent mentions?

It runs on a Ubuntu 24.10 server, with nginx/1.26.0 and PHP 8.3.11

0 likes
2 replies
asdasdsa's avatar

I made another observation: when i finally can click on the links and get to the desired page, i get nothing on the tcpdump. When i disable javascript, everything disappears.

ofc i have php artisan inertia:start-ssr activated and running.

asdasdsa's avatar
$ curl 127.0.0.1:13714
{"status":"NOT_FOUND","timestamp":1733846743327}

php artisan inertia:start-ssr is running, and TCP gives some output

Please or to participate in this conversation.