【发布时间】:2020-10-23 22:58:45
【问题描述】:
我有一个角度 PWA,它不会离线启动(http 错误 504)。当我检查 /ngsw/state 我得到这个错误:
Error: Hash mismatch (cacheBustedFetchFromNetwork): https://example.com/favicon.ico: expected 566d8535a3adc2f7210a8a890bdc50ec4f91f0e3, got 8e076950c4c615772d8d5d753e07377bab9f2f27 (after cache busting)
at PrefetchAssetGroup.<anonymous> (https://example.com/ngsw-worker.js:734:35)
at Generator.next (<anonymous>)
at fulfilled (https://example.com/ngsw-worker.js:174:62))
Latest manifest hash: 5952e5e67f8b4ee7115ef9d519a346712927b608
使用 角 CLI:9.1.9 节点:12.16.1 角度:9.1.11
PWA 上的灯塔检查没有给我任何错误,并且在我使用 .htaccess 的 apache 服务器上重定向角度路由
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /index.html [NC,L]
任何人的想法?谢谢!
【问题讨论】:
-
我认为这是路由的问题,因为有时当我在桌面浏览器中打开 pwa (example.com) 时,我会得到一个找不到页面,但如果我添加 /index.html ( example.com/index.html) 最后,然后它可以工作......但它是随机的
标签: angular progressive-web-apps angular-service-worker