From 63671ea85b90b12a6cf3ad09b61b2381e564e5af Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 3 Apr 2026 18:58:24 -0500 Subject: [PATCH] Fix SW excluding all /_* paths, breaking SvelteKit nsites MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fetch event handler was skipping all paths starting with `/_`, intended to protect iframe-fetch-client system files. But this also excluded SvelteKit asset paths like `/_app/immutable/chunks/*.js`, causing them to bypass JSON-RPC and hit the network directly, which returns HTML instead of JavaScript. Narrow the exclusion to only `/_iframe-client/` — the specific prefix used by the iframe-fetch-client's own assets. --- services/iframe-fetch-client/sw.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/services/iframe-fetch-client/sw.js b/services/iframe-fetch-client/sw.js index 4218af5c..c8ed17fa 100644 --- a/services/iframe-fetch-client/sw.js +++ b/services/iframe-fetch-client/sw.js @@ -138,18 +138,10 @@ self.addEventListener("fetch", (event) => { return; } - // Let iframe client system files be handled normally - if (url.pathname.startsWith("/_") || url.pathname === "/sw.js") { - return; - } - - // Let root path be handled normally (loads the iframe client page) - if (url.pathname === "/") { - return; - } - - // Let iframe client assets be handled normally (anything in _iframe-client directory and common assets) + // Let iframe client system files and common assets be handled normally if (url.pathname.startsWith("/_iframe-client/") || + url.pathname === "/sw.js" || + url.pathname === "/" || url.pathname === "/favicon.ico" || url.pathname === "/manifest.webmanifest") { return;