7

Angular 10.2.4 Progressive Web App is served on Apache Tomcat 9.0.41 over HTTPS and can work offline. After an update to Google Chrome Version 89.0.4389.72 (64-Bit) we get a warning in DevTools on first load:

Site cannot be installed: Page does not work offline. Starting in Chrome 93, the installability criteria is changing, and this site will not be installable. See https://goo.gle/improved-pwa-offline-detection for more information.

Also in the network tab, I see two failing fetches:

Name Path Url Status Type Initiator
example.com / https://example.com (failed) net:ERR_INTERNET_DISCONNECTED fetch ngsw-worker.js:2795
ngsw.json?ngsw-cace-bust=0.8890368493450784 /ngsw.json https://example.com/ngsw.json?ngsw-cache-bust=0.8890368493450784 (failed) fetch ngsw-worker.js:2795

The PWA can still be installed without problems.

This warning is also shown when a new Angular project is created from scratch (for Angular version 10.2.4):

ng new
ng add @angular/pwa

Any ideas on what causes this warning and the failing network fetches...?

Harald Weiner
  • 71
  • 1
  • 4

1 Answers1

8

Changing 'start_url' in 'manifest.webmanifest' to '/index.html' was the solution for me (see issue on Github):

"start_url": "/index.html",

The warning in DevTools does not appear any more and I am still able to install the PWA. I will use this solution as a workaround until there is an official fix.

Update (17/04/2021): Google just updated the blog post and withdrawed the change. The warning will be removed around Google Chrome v90. So we can undo the changes on the service worker (since the Angular service worker already works offline).

Oliver
  • 144
  • 5
  • I'm not sure if "./index.html" should be the right value, there are some people complaining about it. I set it to the absolute value, "/index.html" and it worked. – mdarefull Mar 16 '21 at 12:48
  • You are completely right. I changed it to the absolute value. Thank you very much! – Oliver Mar 16 '21 at 18:08