-
-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service worker registration error #2873
Comments
Thank you very much for opening up this issue! I am currently a bit overwhelmed by the many requests that arrive each week, so please forgive me, if I fail to respond personally. I am still very likely to at least skim read your request and I'll probably try to fix all (real) bugs if possible and I will likely review every single PR being made (please, give me a heads up if you intent to do so) and I will try to work on popular requests (please upvote via thumbs up on the original issue) whenever possible, but trying to respond to every single issue over the last years has been kind of draining and I need to adjust my approach for this project to remain fun for me and to make any progress with actually coding new stuff. Thanks for your understanding! |
Update: I've discovered that the error was due to the It turns out that in the |
Service Worker is only run for web. If you Use |
Your Environment
Current Behavior
When the app is bootstrapped, the service worker is registered according to src/main.ts
Looking at the console, there is an error with registering service worker and the
catch
clause is run. The error is:TypeError: ServiceWorker script at http://localhost:4200/ngsw-worker.js for scope http://localhost:4200/ encountered an error during installation.
Expected Behavior
If you register it, you expect it to be successful, correct?
The service worker not being installed also means that this code block in the NotifyService is skipped:
Steps to Reproduce (for bugs)
npm run serveProd
. This is to ensure that we are inproduction
environment and the app will register the service worker.http://localhost:4200
.Can you reproduce this reliably?
Yes
Console Output
Error Log (Desktop only)
The text was updated successfully, but these errors were encountered: