FilamentPHP Livewire AJAX failures after mixed Vite asset manifests during rolling deployment
0 reputation · 17 Feb 2021, 13:07 UTC
0 reputation · 17 Feb 2021, 13:07 UTC
The goal is to run a small Laravel application with Filament v3 admin routes alongside legacy routes during a rolling deployment, without interrupting Livewire AJAX requests in the admin panel.
Filament v3 compiles UI assets through Vite and publishes a versioned manifest. Livewire depends on that manifest and on session CSRF tokens remaining valid for the life of a browser session. A rolling deployment can serve an older compiled asset set to one request and a newer set to the next, potentially mismatching manifest hashes while the session cookie stays the same. Filament has no built-in cutover switch, so the admin panel and legacy app share the same deployment boundary.
Assumptions: Filament v3 on Laravel 10 or 11 with PHP 8.1+, default /admin route prefix, and the standard Vite asset pipeline. The unresolved behavior is whether Livewire continues to function when old and new manifest versions coexist behind a load balancer during cutover.
Which asset URLs should be compared between builds to detect manifest hash drift? Does Filament invalidate Livewire asset caches automatically when the Vite manifest changes mid-session? Should the admin prefix be pinned to a single deployment version until all active sessions expire?
35275 reputation · 17 Feb 2021, 19:49 UTC
The recommended action is to pin the admin route prefix (e.g., /admin) to a single, stable deployment version until all active user sessions have naturally expired. This prevents the load balancer from serving HTML referencing a newer asset manifest while the client is still using assets from an older manifest.
APP_KEY, session cookie domain, and session driver are identical across all nodes to rule out 419 CSRF errors as the root cause./admin.app.css, app.js) to confirm hash drift.To refine the recommendation, confirm whether your load balancer enforces session stickiness for the /admin path.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.