A discussion on a support forum addresses a ‘Failed to register Service Worker: Security Error’ in Chrome, caused by a redirect issue. Terrapop reports the error after a recent update, noting a 403 error for the script loading the service worker. Falco investigates, confirming the service worker file returns a 200 but suspects a redirect issue, while Terrapop clarifies the script error is unrelated to the redirect. After checking the network tab and disabling cache, Terrapop confirms the issue persists. Falco notes a 302 redirect on their end, suggesting a potential misconfiguration. After a second app rebuild, Terrapop reports the error is resolved, indicating the issue was likely a caching or deployment glitch.
Since the latest update we get the following JS errors re Service Worker in Chrome:
The script resource is behind a redirect, which is disallowed.
_application-786bec8dbeba5dccf3118668436791948e535eb587456944e94e0724bc417b14.js:76435
Failed to register Service Worker: SecurityError: Failed to register a ServiceWorker for scope ('https://www.xxxxx.com/') with script ('https://www.xxxxxx.com/service-worker.js'): The script resource is behind a redirect, which is disallowed.
Could not load content for https://cdn-uploads.xxxxxxx.com/assets/_application-786bec8dbeba5dccf3118668436791948e535eb587456944e94e0724bc417b14.js (HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE)
when I look up the script in the debug console.
Seems, it is not there. Will try a rebuild the app now once again. Maybe a glitch?
So the _aplication is a Chrome DevTools mistake. It’s the pretty printed version of application, so it doesn’t really exists. That’s not the issue this topic is about…
So it’s not behind a redirect. Maybe your browser cached this a redirect on that URL? Can you check this specific request in DevTools Network tab?