From 4dd9088f25534a9114bdf3833dc4044dbf11513c Mon Sep 17 00:00:00 2001 From: k00b Date: Wed, 5 Mar 2025 10:58:23 -0600 Subject: [PATCH] fix #1945 --- sw/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sw/index.js b/sw/index.js index 6e5c875c..705aba74 100644 --- a/sw/index.js +++ b/sw/index.js @@ -31,6 +31,10 @@ self.addEventListener('install', () => self.skipWaiting()) // Also, the offline fallback only works if request matched a route setDefaultHandler(new NetworkOnly({ plugins: [{ + fetchDidFail: async (args) => { + // tell us why a request failed in dev + // process.env.NODE_ENV !== 'production' && console.log('fetch did fail', ...args) + }, fetchDidSucceed: async ({ request, response, event, state }) => { if ( response.ok &&