Does the problem still occur after running the following commands:
php artisan optimize:clear
php artisan nova:publish
Laravel Version: 9.21.6 Nova Version: 4.12.12 PHP Version: 8.0.21
Description: i'm currently having some Problems on my Nova Backend that occurs only on the Live Server, it works just fine on my local development machine. When i click something on the sidebar of the Backend (under "Ressources", for Example "Users") i always get a popup with an error message "All Inertia requests must receive a valid Inertia response, however a plain JSON response was received." and a dump of the JSON output. If i directly open one of the links from the sidebar (right mouse click, open in new tab) it works. Can somebody help?
Regards, Gianluca
ok, after some digging it seems that on my live server, which is a standard hosted server the correct headers were not sent. Nova 4 is based on Inertia which requires that the correct headers are sent otherwise the response will be interpreted as standard json. In my case (Apache + htaccess) I added:
<IfModule mod_headers.c>
Header append X-Inertia: true
</IfModule>
to the .htaccess and it works now but I would still like to know why those headers were suppressed in the first place.
Please or to participate in this conversation.