I did everything as written in \"https://angular.io/guide/service-worker-getting-started\" to make my application PWA.
Used exactly this commands:
n
It seems the service worker setup is broken for the @angular/cli@7.1.4:
As a temporary solution you can register it manually yourself by modifying the file src/main.ts (Once fixed you can remove the manual service worker registration.):
.....
platformBrowserDynamic().bootstrapModule(AppModule).then(() => {
if ('serviceWorker' in navigator && environment.production) {
navigator.serviceWorker.register('/ngsw-worker.js');
}
}).catch(err => console.log(err));
PS: Github issue created: https://github.com/angular/angular-cli/issues/13351
PS: Github issue #2 created: https://github.com/angular/angular-cli/issues/15025