#10764·livewire

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/1 is live, serving ⚡dashboard.blade.php compiled to livewire/classes/3f9a1c2e.php
  • 12:01:00 – deployment is triggered, releases/2 is cloned and its ⚡dashboard.blade.php gets mtime 12:01:00
  • 12:01:30 – deployment script runs php artisan optimize, which clears storage/framework/views/livewire
  • 12:01:32 – releases/1 handles a request and recompiles the component from its old source to 3f9a1c2e.*
  • 12:01:35 – current is switched to releases/2
  • 12:01:36 – releases/2 handles a request, finds the compiled 3f9a1c2e.* 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():

php
return substr(md5(Str::after($sourcePath, base_path())), 0, 8);