Fall back to the raw path when strict mode rejects an already-resolved entrypoint - #265
Open
Amoifr wants to merge 1 commit into
Open
Fall back to the raw path when strict mode rejects an already-resolved entrypoint#265Amoifr wants to merge 1 commit into
Amoifr wants to merge 1 commit into
Conversation
Amoifr
force-pushed
the
fix-230-strict-mode-manifest
branch
2 times, most recently
from
July 21, 2026 16:05
f2b2886 to
cbbe866
Compare
Amoifr
force-pushed
the
fix-230-strict-mode-manifest
branch
from
July 21, 2026 16:23
cbbe866 to
89da581
Compare
Author
|
Heads-up on the red Fabbot check: it is a false positive coming from two of its steps disagreeing with each other. I went without the return type, which matches every existing test method in the suite and the |
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.
entrypoints.jsonalready stores the final public paths of the built assets, butTagRendererpasses each one back throughpackages->getUrl(). When the default asset package is backed by the JSON manifest (framework.assets.json_manifest_path) withframework.assets.strict_mode: true, the strategy treats the already-resolved path as a manifest key, fails to find it and throwsAssetNotFoundException, soencore_entry_link_tags()/encore_entry_script_tags()blow up. Withstrict_mode: falsethe same call silently returns the path unchanged, which is why the bug only shows up in strict mode (reported by @bmorg, kept open by @Kocal).I reproduced it against the real asset component:
getUrl('/web-subfolder/app.b75294ae.css')throws in strict mode, whilegetUrl('my-prefix/app.css')(the manifest key) resolves fine.This catches
AssetNotFoundExceptioningetAssetPath()and falls back to the raw path, which is already the correct, final one, matching whatstrict_mode: falsedoes today. Realasset()calls elsewhere keep their strict-mode behavior untouched. I deliberately kept thegetUrl()call rather than removing it (as the issue suggested), since it is what applies a base path / CDN to the entrypoint values.@Kocal, since this touches the entrypoints / manifest / base-path interaction, I went for the smallest safe fix but I'm happy to adjust the direction if you had something else in mind.
Thanks a lot for the bundle! 🙏