angular: service worker fails to load css file

🐞 bug report

Affected Package

The issue is caused by package @angular/service-worker

Is this a regression?

I have not seen a version where this doesn't happen

Description

Followed getting started steps:

  1. npm install -g @angular/cli
  2. ng new my-app (selected no to router, used scss)
  3. ng add @angular/pwa --project my-app
  4. the only update i made to the code was to the styles.scss file adding: body { background-color: yellow; }
  5. ng build --prod
  6. run with http-server
  7. create short cut with chrome on desktop version (Version 70.0.3538.110 (Official Build) (64-bit))

🔬 Minimal Reproduction

🔥 Exception or Error




The FetchEvent for "https://mmciodev.mge.com/styles.f37e128c6af9ca929fb7.css" resulted in a network error response: the promise was rejected.
ngsw-worker.js:1 Uncaught (in promise) DOMException: Entry already exists.

🌍 Your Environment

Angular Version:




Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.11.2
@angular-devkit/build-angular     0.11.2
@angular-devkit/build-optimizer   0.11.2
@angular-devkit/build-webpack     0.11.2
@angular-devkit/core              7.1.2
@angular-devkit/schematics        7.1.2
@angular/pwa                      0.11.2
@ngtools/webpack                  7.1.2
@schematics/angular               7.1.2
@schematics/update                0.11.2
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.23.1

Anything else relevant?

Chrome Version 70.0.3538.110 (Official Build) (64-bit) cache-css error-failed

It is very difficult to reproduces this error consistently, almost like it is a race condition. But having a chrome shortcut on my desktop seems to reproduce it the most often, when chrome is not currently open.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 17 (2 by maintainers)

Most upvoted comments

I found a website which produce randomly the same bug: https://deanhume.github.io/beer/ The error in console:

The FetchEvent for “https://z2s71hp3o9.execute-api.us-east-1.amazonaws.com/default/styles” resulted in a network error response: the promise was rejected.