#3231·inertia

`withFragment()` causes Inertia visit to return 409 Conflict

Author: Lukasss93Created Aug 25, 2026Updated Aug 25, 2026

Inertia adapter(s) affected

  • React
  • Vue 3
  • Svelte
  • Not Applicable

JS package version

3.6.0

Backend stack (optional)

Laravel 13.26 PHP 8.5

Describe the problem

When performing an Inertia visit that calls a Laravel controller method containing ->withFragment(...), the request completes successfully on the server but the browser receives a 409 Conflict response.

This prevents any deferred functions registered with defer() from being executed, since the request is treated as a conflict. Using ->always() on the deferred function makes it run, but this defeats the purpose of deferred execution.

Example:

php
public function updateThat(Request $request)
{
    // do things...
    
    defer(function() {
        // do deferred things...
    }); // <- never called due to 409 Conflict
    
    return back()->withFragment('my-tab'); // <- always 409 Conflict
}

Expected behavior

The Inertia visit should complete successfully when using withFragment(), and deferred functions should be executed normally.

Actual behavior

The response is returned as 409 Conflict, causing the deferred function to be skipped unless ->always() is used.

Steps to reproduce

  1. Create a Laravel controller method handled through an Inertia visit.
  2. Register a deferred function using defer().
  3. Return a redirect using back()->withFragment('my-tab').
  4. Trigger the controller method through an Inertia request.
  5. Observe that the browser receives a 409 Conflict response.
  6. Observe that the deferred function is never executed.
  7. Replace defer() with defer(...)->always() and observe that the function is executed.