prevent cache startup error

This commit is contained in:
ayyo42069
2026-02-22 13:08:43 +01:00
parent 45add35c8a
commit 1ed04c530f
+3 -2
View File
@@ -76,9 +76,10 @@ __patcherApp.all(/(.*)/, async (req, res) => {
filePath += '.html'; 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') { 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)) { if (!__patcherFs.existsSync(__patcherTempPath)) {