-
Notifications
You must be signed in to change notification settings - Fork 267
Description
PHP package version
2.0.12
Inertia adapter(s) affected (if any)
- React
- Vue 3
- Svelte
- Not Applicable
Backend stack
Laravel Vapor 2.41.0
Laravel Framework 12.42.0
PHP 8.4
Installed using Laravel Vue3 Starter Pack
Describe the problem
Hello,
Forgive me if this belongs in the documentation ticket area, I wasn't sure if it was solely a documentation issue.
Inertia seems to send blank version strings causing 409 errors across navigations, specifically when a new routing group is registered besides the "Web" group.
It seems that this statement App::call in line ends up returning null, even if the user customized the version() function in HandleInertiaRequests.php
inertia-laravel/src/ResponseFactory.php
Line 142 in 0473196
| ? App::call($this->version) |
I found that loading this additional middleware resolves the issue:
\Illuminate\Routing\Middleware\SubstituteBindings::class
This was tested using dd(app()) function and inspecting the bindings array output when making requests to the new routing group. The HandleInertiaRequests entry was missing.
Steps to reproduce
Install Laravel Starter Kit, with Vue3
Follow Laravel docs to create a new subordinate routing group:
https://laravel.com/docs/12.x/routing#routing-customization
Add HandleInertiaRequests::class to the new routing group and create a response controller for it that uses Inertia::Render
Observe settings in HandleInertiaRequests not being used and the default class from inertia Response.php being used instead.