Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New warning "Site cannot be installed: Page does not work offline. Starting in Chrome 93..." after Chrome update in Angular 10 PWA

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...?

like image 367
Harald Weiner Avatar asked Mar 05 '21 09:03

Harald Weiner


1 Answers

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).

like image 92
Oliver Avatar answered Nov 07 '22 19:11

Oliver