khalyomede / gridsome-plugin-service-worker

Registers a service worker and apply your file strategies to let you build a PWA.
https://npmjs.com/package/gridsome-plugin-service-worker
MIT License
8 stars 2 forks source link

cacheOnly is not defined #10

Closed u12206050 closed 3 years ago

u12206050 commented 3 years ago

Thanks for the plugin. Unfortunately I am getting an error cacheOnly is not defined even though I am not using cacheOnly

This is my full config:

   {
      use: "gridsome-plugin-service-worker",
      options: {
        cacheFirst: {
          cacheName: 'cf-v2',
          fileTypes: [
              "image",
              "font"
          ]
        },
        staleWhileRevalidate: {
          cacheName: "swr-v2",
          fileTypes: [
            "document",
            "audio",
            "script",
            "style",
          ],
        },
      },
    }

and this is the error in the console:

service-worker.js:1 Uncaught ReferenceError: cacheOnly is not defined
    at service-worker.js:1
    at service-worker.js:1

service-worker.js:1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://activechristianity.africa/') with script ('https://activechristianity.africa/service-worker.js'): ServiceWorker script evaluation failed
khalyomede commented 3 years ago

Thanks for raising this issue, gonna get this a look soon