-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asset hashing is not handled correctly in Universal #15953
Comments
In case your client bundles use outputHashing you should set |
Oh well, that fixed it. Worth an entry in the documentation i guess. How would i have to include that, so it also will be bundled for the server? |
Strictly speaking it shouldn't be included in the server output, as the server should re-use the browser assets. Related issue: #12878 |
In case the browser builder hashes the assets we need to add this setting to the server builder as otherwise when assets it will be requested twice. One for the server which will be unhashed, and other on the client which will be hashed. Closes #15953
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report
What is the expected behavior?
When using output-hashing universal gets the information of the assets and can use those from the client to prevent loading the same asset twice.
What is the current behavior?
When using output-hashing it tries to access the image from the served apps folder without hashes. Therefore, it can't load the image when serving the server version. Only when the client app takes over, the images are rendered.
What modules are related to this issue?
Minimal reproduction with instructions:
https://github.com/drdreo/ng-universal-hashing-demo
What is the use-case or motivation for changing an existing behavior?
This might has to do something with the universal server setup which could be more detailed for such use-cases where you have a folder structure like.
Environment:
@nguniversal versions
"@nguniversal/common": "^8.1.1",
"@nguniversal/express-engine": "^8.1.1",
"@nguniversal/module-map-ngfactory-loader": "^8.1.1",
Is there anything else we should know?
It only affects assets via css like: fonts or background images etc.
I have 3 locale apps with different output hashing settings for testing purpose:
en & it apps can handle the background-image because the server app requests the image without a hash. But the fr version can not render the image and requests the image twice. One not hashed & one hashed as seen in the video. The sun.jpg should be the background.
The text was updated successfully, but these errors were encountered: