Я использую Angular 7 в сочетании с работником службы Angular. Но после развертывания новой версии приложения я получаю эту ошибку в большинстве случаев, и приложение запускается только после обновления:
The FetchEvent for "https://example.com/runtime.e0d7b28adf942e10148b.js" resulted in a network error response: the promise was rejected.
ngsw-worker.js:589 Uncaught (in promise) Error: Response not Ok (fetchAndCacheOnce): request for https://example.com/runtime.e0d7b28adf942e10148b.js returned response 504 Gateway Timeout
at PrefetchAssetGroup.<anonymous> (ngsw-worker.js:589)
at Generator.next (<anonymous>)
at fulfilled (ngsw-worker.js:312)
runtime.e0d7b28adf942e10148b.js:1 Failed to load resource: net::ERR_FAILED
Это конфигурация ngsw-config.json:
"index": "/index.html",
"assetGroups": [{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}]
В настоящее время HTTP-кеш также включен, может ли это вызывать проблемы?