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.

2
  • Are you using http/2 push? I am getting the same error from Lighthouse after I (only) implemented pushing resources.
    – alesc
    May 26, 2017 at 18:11
  • No, I'm not using http push May 26, 2017 at 19:04

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.