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

mooseh's avatar

Inertia Persistent layout error handling

So I am using Inertia with Vue2 in our application. I am using a layout for the entire app with inertia link's, which allows me to use a persistent audio player.

I have used the global middleware to make sessions persist into Exception handlers. and I am using Inertia::render('Error', [$data]) for my exceptions page handlers.

but this player is not persisting when running through the exception handler. I will describe what happens.

  • user goes to /home with no problem and starts playing a podcast in the header.
  • user clicks a link to another valid page and the player continues to play with no problem.
  • user clicks a link to a page which returns 404 and shows the inertia rendered error page and the player still continues playing
  • the user clicks the "go back" link (or any link for that matter) which is an inertia link but the player stops playing and a full reload is performed

just before the full page reload is performed i can see there is a http 409 conflict which im guessing prompts the reload.

I don't get why inertia is forcing the full reload when from away from the error page. but I don't want anything disrupting the player as it's a hugely important feature.

0 likes
0 replies

Please or to participate in this conversation.