'Failed to register a ServiceWorker (404 error) using WebEssentials.AspNetCore.PWA
I've been adding WebEssentials.AspNetCore.PWA to several of my sites recently and it's all gone very easily, (to be fair it's very easy to install).
But one site is giving me a real headache and is always reporting the following error:
Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://dawson-floridavilla.co.uk/') with script ('https://dawson-floridavilla.co.uk/serviceworker'): A bad HTTP response code (404) was received when fetching the script.
I also receive a 404 error for manifest.webmanifest.
If I try to navigate to https://dawson-floridavilla.co.uk/serviceworker I receive a 404 error where the other sites all show the ServiceWorker JavaScript code.
The site isn't very complicated so I'm not sure what to strip back to test for any incompatibilities, all four sites I've attempted/implemented are ASP.NET Core 3.1 running on a Windows 10 VS Studio Dev Server or a Debian 10 Production Server.
Has anybody else had similar issues? I think the package is attempting to run as it adds the lines for the serviceworker script and the webmanifest but both return 404 errors as above.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
