inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.01k stars 224 forks source link

inertia laravel opens the page in a new modal #556

Open PanWcislo opened 9 months ago

PanWcislo commented 9 months ago

I have a problem with inertia and laravel. After updating files on the server, it sometimes happens that when switching between pages, the page will open in a new modal window. I don't know exactly what the problem is, but I think it's related to the cache and Laravel Mix and using webpack mix.version() in production?

craigrileyuk commented 7 months ago

I think it's related to the cache and Laravel Mix and using webpack mix.version() in production?

It isn't. If you're seeing a modal in inertia, it's because you're sending a request for an Inertia page from the browser, but the server is sending back a standard HTML response.

Ensure that you have the Inertia Middleware installed properly and that it's applied on all relevant routes.

Furthermore, make sure that your controllers are returning either an inertia response or a redirection to an inertia response (e.g. return back();)

If you nail down the pages where the modal opens, this should help you track down the controller methods/routes where the issues are.