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.

Gaetano Herman
  • 524
  • 6
  • 22

1 Answers1

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