Lighthouse & Polymer: start_url in manifest is not cached by Service Worker
Asked Answered
S

1

10

I'm testing my Polymer application and I get a pretty good score on Lighthouse. However, I still have a small problem. I have a manifest.json file containing everything so the app can be added to the home screen, but Lighthouse still gives a failure saying: Manifest start_url is not cached by a Service Worker.. I'm using the Polymer Starter Kit 2.0 and I have no idea how to cache it with the Service Worker. I have a sw-precache-config.js containing:

module.exports = {
  staticFileGlobs: [
    '/index.html',
    '/index.html?launcher=true',
    '/manifest.json',
    '/bower_components/webcomponentsjs/*',
  ],
  navigateFallback: '/index.html',
};

Where /index.html?launcher=true is the start_url of the manifest.

Seaward answered 24/5, 2017 at 11:30 Comment(2)
Are you using http/2 push? I am getting the same error from Lighthouse after I (only) implemented pushing resources.Placencia
No, I'm not using http pushSeaward
A
0

I think in your "index.html" file you have :

rel="manifest" href="manifest.json"
You have to change it by :
rel="manifest" href="/manifest.json"

You can find a codelabs provided by Google's team here : https://codelabs.developers.google.com/codelabs/add-to-home-screen/#3

Attenborough answered 11/7, 2017 at 17:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.