I'm always get the error like below when using service worker with angular v8 which did not happend in v7
Below is my config
package.json
"@angular/animations": "~8.2.14",
"@angular/common": "~8.2.14",
"@angular/compiler": "~8.2.14",
"@angular/core": "~8.2.14",
"@angular/forms": "~8.2.14",
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/pwa": "^0.900.2",
"@angular/router": "~8.2.14",
"@angular/service-worker": "~8.2.14",
angular.json
"assets": [
"src/assets/favicon.ico",
"src/assets",
"src/manifest.json"
],
"configurations": {
"production": {
// other is ommitted
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
}
}
ngsw-config.json
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/assets/favicon.ico",
"/manifest.json",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/images/**"
]
}
}
]
}
app.module.ts
imports: [
BrowserModule,
ServiceWorkerModule.register("ngsw-worker.js", {
enabled: environment.production
})
],
index.html
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#1976d2">
Please help me to point out what I have missed.
Much appriciated.