I have encountered this while hosting a Symfony app in a subfolder and managed to reproduce it with a minimal test case.
The behavior only shows when framework.assets.strict_mode is set to true.
Error
The error thrown is: Asset "/web-subfolder/app.b75294ae.css" not found in manifest ".../build-output/manifest.json". Did you mean one of these? "my-prefix/app.css", "my-prefix/app.js"
Reproduce
To demonstrate the problem I am setting three different values for these three directories:
I'm not really sure I completely understand how all the parts work together, but it seems to me that there is no need to call getAssetPath in TagRenderer->renderWebpackLinkTags (here), since the entrypoint already provides the "mapped" values.
Demo
I have created a demo repository here. The relevant changes to reproduce are in this commit.
I have encountered this while hosting a Symfony app in a subfolder and managed to reproduce it with a minimal test case.
The behavior only shows when
framework.assets.strict_mode
is set totrue
.Error
The error thrown is:
Asset "/web-subfolder/app.b75294ae.css" not found in manifest ".../build-output/manifest.json". Did you mean one of these? "my-prefix/app.css", "my-prefix/app.js"
Reproduce
To demonstrate the problem I am setting three different values for these three directories:
setOutputPath
):'build-output/'
setPublicPath
):'/web-subfolder'
setManifestKeyPrefix
):'my-prefix/'
manifest.json
:entrypoints.json
:Template:
Fix
I'm not really sure I completely understand how all the parts work together, but it seems to me that there is no need to call
getAssetPath
inTagRenderer->renderWebpackLinkTags
(here), since the entrypoint already provides the "mapped" values.Demo
I have created a demo repository here. The relevant changes to reproduce are in this commit.