GoogleChromeLabs / sw-precache

[Deprecated] A node module to generate service worker code that will precache specific resources so they work offline.
https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
Apache License 2.0
5.22k stars 388 forks source link

Cannot read property 'keys' of undefined #338

Open toonvanstrijp opened 6 years ago

toonvanstrijp commented 6 years ago
Uncaught (in promise) TypeError: Cannot read property 'keys' of undefined
    at setOfCachedUrls (service-worker.js:144)
    at service-worker.js:156
    at <anonymous>

I'm using the following config:

module.exports = {
  navigateFallback: '/index.html',
  stripPrefix: 'wwwroot',
  root: 'wwwroot/',
  staticFileGlobs: [
    'wwwroot/index.html',
    'wwwroot/**.js',
    'wwwroot/**.css'
  ]
};
jeffposnick commented 6 years ago

root isn't a supported option. Could you remove the root: 'wwwroot/', and see if that helps?