You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
I use the Critical lib. When I use it, it's break the Angular Service Worker.
When using Critical, this is logs from Network panel :
When not using Critical, this is logs from Network panel :
As you may know, Critical handle the CSS. The script I use is just replace some CSS relative lines in my index.html. When using it, it's like preventing the SW to do all his work.
The issue is when we go offline, the refresh doesn't work, nothings seems to be cached by the SW.
Expected behavior
Using Critical and SW is ok with that.
Minimal reproduction of the problem with instructions
This happens, because the SW keeps a list of hashes for the known files (including index.html) and when receiving a file from the server compares the stored hash with the hashed content to see if they match. (The hash is based on the content, so if Critical is modifying the content after the hash has been computed (during ng build --prod) there will be a hash mismatch.)
This is currently working as expected. Maybe you could open an issue on CLI to add support for a way to hook into the build process at specific times (i.e. after index.html has been generated, but before the hash is computed).
As a work-around, you could run the following command at the end to re-compute the hashes (but it might have unexpected side-effects - I haven't thoroughly tested it):
Activity
gkalpak commentedon Aug 3, 2018
This happens, because the SW keeps a list of hashes for the known files (including
index.html) and when receiving a file from the server compares the stored hash with the hashed content to see if they match. (The hash is based on the content, so if Critical is modifying the content after the hash has been computed (duringng build --prod) there will be a hash mismatch.)This is currently working as expected. Maybe you could open an issue on CLI to add support for a way to hook into the build process at specific times (i.e. after
index.htmlhas been generated, but before the hash is computed).As a work-around, you could run the following command at the end to re-compute the hashes (but it might have unexpected side-effects - I haven't thoroughly tested it):
angular-automatic-lock-bot commentedon Sep 14, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.