Angular universal not working with service workers
See original GitHub issue🐞 bug report
Description
Angular Universal (SSR) not working with the service workers, I didn’t get any error but the index.html page not renders in the server as before :
-
before adding the service workers : https://drive.google.com/open?id=1V7PFlBLD995_HlxLYBrO9IuZ-K0qW33Q
-
after adding the service workers: https://drive.google.com/open?id=160-k6yVyMNwTkvDeDu4-BlmZkN6k9jf6
🔬 Minimal Reproduction
GitHub repository: https://github.com/walid-hajhussien/Recipe-books Branch: master
🌍 Your Environment
"@angular/animations": "~9.0.3", "@angular/common": "~9.0.3", "@angular/compiler": "~9.0.3", "@angular/core": "~9.0.3", "@angular/forms": "~9.0.3", "@angular/platform-browser": "~9.0.3", "@angular/platform-browser-dynamic": "~9.0.3", "@angular/platform-server": "~9.0.3", "@angular/router": "~9.0.3", "@angular/service-worker": "~9.0.3", "@ngrx/effects": "^9.1.0", "@ngrx/store": "^9.1.0", "@ngrx/store-devtools": "^9.1.0", "@nguniversal/express-engine": "^9.0.1", "angular-user-idle": "^2.2.2", "bootstrap": "^3.4.1", "express": "^4.15.2", "ng-connection-service": "^1.0.4", "rxjs": "~6.5.4", "tslib": "^1.10.0", "zone.js": "~0.10.2"
Anything else relevant? the issue happens when you tried to combine both Angular Universal (SSR) & service workers
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@walid-hajhussien, can you please provide instructions on how to reproduce the issues you are seeing.
If I had to guess, I would say that what happens is this:
index.html
file is served from the server, where it is rendered before being sent to the client.index.html
is served from the SW (so no SSR, since the request never hits the server).This is generally working as intended. Generally, the idea of prerendering is that it kicks in on the first load (to speed up the first rendering) and on subsequent loads the SW takes over and speeds up the rendering by serving the HTML and other resources from the local cache (and only fetching the necessary data). Prerendering is also useful in other contexts (such as SEO, link previews, etc.) where the clients are not using ServiceWorkers.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.