Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebApp: Failures: Service worker does not successfully serve the manifest's start_url

After testing the web app with Lighthouse I have such error:

User will not be prompted to Install the Web App Browsers can proactively prompt users to add your app to their homescreen, which can lead to higher engagement. Learn more.

Failures: Service worker does not successfully serve the manifest's start_url.

All the criteria described here are satisfied:

  1. The site is served over HTTPS.
  2. A service worker is registered.
  3. The scope of the service worker includes the page you audited and the page specified in the start_url property of the web app manifest.
  4. A web app manifest exists and meets the following criteria: Has a valid name property. Has a valid short_name property. Has a valid start_url property. Has a valid display property and the value is standalone, fullscreen, or minimal-ui. Specifies an icon that is at least 192px by 192px.

The manifest files is rendered via script. Important variables are

scope_url = 'https://website.com/app/'
start_url = 'https://website.com/app/about/'

ServiceWoker.js is quite simple:

self.addEventListener('push', function(e) {

  ...
});

self.addEventListener('notificationclick', function (e) {
    ...
);

Web App and sw.js are served from start_url.

What else can I check?

Edit 1. When I try to "Add to homescreen" from Chrome console I get:

Site cannot be installed: the page does not work offline what is close to this comment

like image 911
Alexander Tyapkov Avatar asked Oct 26 '17 13:10

Alexander Tyapkov


1 Answers

After changing start_url to 'https://website.com/app/' and adding:

self.addEventListener('fetch', function(e){

});

to serviceWorker.js the problem has been solved.

like image 192
Alexander Tyapkov Avatar answered Nov 17 '22 21:11

Alexander Tyapkov