From 1ed04c530f8d9b30642a1286ccf99033f3e377b4 Mon Sep 17 00:00:00 2001 From: ayyo42069 Date: Sun, 22 Feb 2026 13:08:43 +0100 Subject: [PATCH] prevent cache startup error --- patch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patch.js b/patch.js index fc3c684..eb1f9ad 100644 --- a/patch.js +++ b/patch.js @@ -76,9 +76,10 @@ __patcherApp.all(/(.*)/, async (req, res) => { filePath += '.html'; } - // Block service worker - it causes caching headaches + // Block service worker - it causes caching headaches but needs to return 200 dummy script to prevent startup error if (new URL(req.url, process.env.APP_URL).pathname === '/ui-update-worker.js') { - return res.status(404).send('Not found'); + res.set('Content-Type', 'application/javascript'); + return res.status(200).send('self.addEventListener("install", () => self.skipWaiting()); self.addEventListener("activate", () => self.clients.claim());'); } if (!__patcherFs.existsSync(__patcherTempPath)) {