From c356597523fe635de0666f2f492382e0d1631769 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 15 Nov 2021 13:03:30 -0600 Subject: [PATCH] sw.js: fix match against undefined pathname --- webpack/production.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webpack/production.js b/webpack/production.js index 220ed8991..37a1a4397 100644 --- a/webpack/production.js +++ b/webpack/production.js @@ -104,7 +104,11 @@ module.exports = merge(sharedConfig, { ]; const isBackendRoute = ({ pathname }) => { - return backendRoutes.some(pathname.startsWith); + if (pathname) { + return backendRoutes.some(pathname.startsWith); + } else { + return false; + } }; return isBackendRoute(requestUrl) && requestUrl;