SFCs render stale views after zero-downtime deployments on Forge
Author: ganyiczCreated Sep 28, 2026Updated Sep 30, 2026
Livewire version
v4.4.5
Laravel version
v13.32.0
PHP version
8.4
Describe the issue you're experiencing
On a fresh Laravel Forge setup with pre-defined deployment script and no customization, single-file components can keep rendering the previous release's code after a deployment.
This is the timeline of a single deployment. releases/1 is live and releases/2 is being deployed. Both symlink storage/ to the same shared directory:
- 12:00:00 –
releases/1is live, serving⚡dashboard.blade.phpcompiled tolivewire/classes/3f9a1c2e.php - 12:01:00 – deployment is triggered,
releases/2is cloned and its⚡dashboard.blade.phpgets mtime12:01:00 - 12:01:30 – deployment script runs
php artisan optimize, which clearsstorage/framework/views/livewire - 12:01:32 –
releases/1handles a request and recompiles the component from its old source to3f9a1c2e.* - 12:01:35 –
currentis switched toreleases/2 - 12:01:36 –
releases/2handles a request, finds the compiled3f9a1c2e.*newer than its source (12:01:00), skips compilation and renders the old component
This stays broken until views are cleared again.
Both releases resolve to the same compiled files because, since #10169, the hash is derived from the path relative to base_path():
return substr(md5(Str::after($sourcePath, base_path())), 0, 8);Source: livewire/livewire