diff --git a/templates/workbox/sw.js b/templates/workbox/sw.js index 039fd0d7..be732839 100644 --- a/templates/workbox/sw.js +++ b/templates/workbox/sw.js @@ -96,7 +96,7 @@ function offlinePage(workbox, options) { const strategy = new workbox.strategies[options.offlineStrategy] return strategy .handle({ request, event }) - .catch(() => caches.match(options.offlinePage)) + .catch(() => caches.matchPrecache(options.offlinePage)) }) } } diff --git a/test/__snapshots__/pwa.test.js.snap b/test/__snapshots__/pwa.test.js.snap index 1abb6ab0..88166db0 100644 --- a/test/__snapshots__/pwa.test.js.snap +++ b/test/__snapshots__/pwa.test.js.snap @@ -200,7 +200,7 @@ function offlinePage(workbox, options) { const strategy = new workbox.strategies[options.offlineStrategy] return strategy .handle({ request, event }) - .catch(() => caches.match(options.offlinePage)) + .catch(() => caches.matchPrecache(options.offlinePage)) }) } }