Repository navigation
Fix components compiling again after view:cache - #2856
Merged
Merged
Conversation
This was referenced Oct 13, 2026
.. so view:cache covers Flux…vers it Blade names a compiled view after the path the view finder returns, and view:cache compiles every file at its real path, so a path with ".." never finds the views view:cache compiled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013KFfWQLT7PsmH3zswyjmqv
fgilio
force-pushed
the
register-views-at-their-real-path
branch
from
October 20, 2026 10:19
2df1ad2 to
f1d2c52
Compare
fgilio
marked this pull request as ready for review
October 20, 2026 10:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013KFfWQLT7PsmH3zswyjmqv
fgilio
force-pushed
the
register-views-at-their-real-path
branch
from
October 20, 2026 10:58
f1d2c52 to
3295088
Compare
Contributor
Author
|
FWIW laravel/framework#62005 has just been merged |
Collaborator
|
Thanks @fgilio ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The scenario
Right after
php artisan view:cache(oroptimize), Flux components still compile on the first request that renders them, on every deploy and on every new instance started from that build.On a fresh app with
livewire/flux, runphp artisan view:cache, then:The problem
Flux registers its components through a path with
..in it:Blade names a compiled view after the path the finder returns, and
view:cachecompiles each file at its real path. So<flux:button>resolves to.../flux/src/../stubs/resources/views/flux/button/index.blade.php, which maps to a different compiled file than the oneview:cachewrote, and Blade (or Blaze) compiles it again. On a read-only filesystem, those requests fail.The solution
Register the same directory without the
..:__DIR__is already a real path, so this matches whatrealpath()would return without a filesystem call. On a fresh app, rendering five Flux components right afterview:cachecompiled 8 Flux views at runtime before this change, and none after.The general fix is laravel/framework#62005, which runs namespace hints through
realpath()like view locations. It only reaches Laravel 13, so this one covers apps on 10, 11 and 12.FluxProServiceProviderregisters its path the same way, so Pro components need the same one-line change.🤖 Generated with Claude Code
https://claude.ai/code/session_013KFfWQLT7PsmH3zswyjmqv