Using InjectManifest in PWA



  • Hi,
    I’m trying to create a PWA app using InjectManifest.
    My service-worker.js has this code (as seen in many examples):

    precacheAndRoute(self.__WB_MANIFEST);
    
    registerRoute(
      new NavigationRoute(createHandlerBoundToURL('/index.html'))
    );
    

    But I’m getting an error:

    Uncaught non-precached-url: createHandlerBoundToURL(’/index.html’) was called, but that URL is not precached. Please pass in a URL that is precached instead.

    How can I get index.html to be precached?


Log in to reply