-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
LH3: does not register a service worker on first report. #5527
Comments
@patrickhulce , in your case the "manifest" is missing? |
+1 for this issue. Finding the same with https://m.jungleerummy.com/ . Lighthouse is reporting that the site doesn't register service worker, but in-fact it does on the landing page load itself. Attached the lighthouse report and SW registration registration screenshots. |
I'm having the same issue when I run Lighthouse on https://thesession.org (using the Audit tab in Chrome). But interestingly, this problem only occurs if throttling is set to the default "Simulated Fast 3G, 4x CPU Slowdown". And looking at #5782, it seems that the problem doesn't happen with the command line interface. So it seems that the issue is isolated to:
|
Same issue, and I confirm @adactio diagnostic. Using Chrome Canary 71 with Lighthouse 3.0.3, on the same app, the "no service worker is registered" error happens with default audit options (Simulated fast 3G...), while it's OK when using option "No throttling". It's also OK in Chrome stable (v68 and Lighthouse 3.0.0-beta.0). |
This issue is now in Chrome stable (70). Any plans on fixing it? |
The behavior you're describing then @cyrilletuzi and @adactio is #599/#2924. The difference between those throttling options is how long we wait for the page to "settle" and in those cases it seems that the service worker doesn't have complete time to register. |
@patrickhulce Do you mean the problem is on the app side (wrong service worker)? Because my app is just using the official Angular service-worker, so if the problem is on the app side, an issue should be reported as soon as possible in Angular. |
@cyrilletuzi not really, it's something on the LH side we'll need to figure out how to handle, just an explanation for why. We're not failing to detect, we're just not waiting long enough to detect it. |
@patrickhulce OK. For info, the app I'm auditing is a small Angular app, so if it's already a problem in a small app, maybe there is something on the Angular side to manage better about the service worker? |
Related #6626 |
FWIW, we started running into this on angular.io. It happens intermittently on the locally served app (using http-server) - i.e. it doesn't happen when testing the app on Firebase hosting - and it happens much more often on CI than on my machine. (We are tracking this in angular/angular#29910.) angular.io is using the Angular SW (obviously 😁), which is intentionally waiting for the app to stabilize (as far as Angular in concerned) before registering. Is there a way to specify a larger timeout for Lighthouse or something? |
|
Update (2): Or maybe not: angular/angular#29921 (comment) 😞 |
I have put any info I have in angular/angular#29910 (although it's mostly specific to the Angular repo/CI). |
@gkalpak yes! You can use a custom config that increases Run Lighthouse with custom config lighthouse --config-path=./foo-config.js <url> foo-config.js module.exports = {
extends: 'lighthouse:default',
passes: [
{passName: 'defaultPass', pauseAfterLoadMs: 10000},
]
} |
The server used for testing on localhost has less optimizations (e.g. serves uncompressed files), so we need to wait longer the ServiceWorker to be loaded and registered to allow Lighthouse to reliably detect it, especially on slower environments (e.g. CI). Related: GoogleChrome/lighthouse#5527 (comment) Fixes angular#29910
The server used for testing on localhost has less optimizations (e.g. serves uncompressed files), so we need to wait longer the ServiceWorker to be loaded and registered to allow Lighthouse to reliably detect it, especially on slower environments (e.g. CI). Related: GoogleChrome/lighthouse#5527 (comment) Fixes angular#29910
Thx, @patrickhulce ❤️
|
The server used for testing on localhost has less optimizations (e.g. serves uncompressed files), so we need to wait longer the ServiceWorker to be loaded and registered to allow Lighthouse to reliably detect it, especially on slower environments (e.g. CI). Related: GoogleChrome/lighthouse#5527 (comment) Fixes angular#29910
Anytime @gkalpak! :) Yeah we might want to consider raising those specific docs up to a FAQ level of some sort as I've seen this fairly often with angular apps. |
…29953) The server used for testing on localhost has less optimizations (e.g. serves uncompressed files), so we need to wait longer the ServiceWorker to be loaded and registered to allow Lighthouse to reliably detect it, especially on slower environments (e.g. CI). Related: GoogleChrome/lighthouse#5527 (comment) Fixes #29910 PR Close #29953
…29953) The server used for testing on localhost has less optimizations (e.g. serves uncompressed files), so we need to wait longer the ServiceWorker to be loaded and registered to allow Lighthouse to reliably detect it, especially on slower environments (e.g. CI). Related: GoogleChrome/lighthouse#5527 (comment) Fixes #29910 PR Close #29953
…ngular#29953) The server used for testing on localhost has less optimizations (e.g. serves uncompressed files), so we need to wait longer the ServiceWorker to be loaded and registered to allow Lighthouse to reliably detect it, especially on slower environments (e.g. CI). Related: GoogleChrome/lighthouse#5527 (comment) Fixes angular#29910 PR Close angular#29953
Original URL (kinoseed.com) works in Chrome stable now. https://www.jungleerummy.com/ (from @prash-mi) seems to no longer have a SW. https://thesession.org/ (from @adactio) works in Chrome stable now. https://angular.io/ works in Chrome (but the issue was only reported for local dev / CI). Since the URLs provided work now, we can close this issue. Please open a new issue if LH fails to detect your SW. @patrickhulce think we could detect angular on the page -> use a higher timeout for |
Bug report
Provide the steps to reproduce
What is the current behavior?
LH does not register site's service worker on the first run ("generate report").
Running "Generate report" after the first run, performs as expected.
What is the expected behavior?
LH should register site's service worker on the first run.
Environment Information
Runtime settings
URL: https://kinoseed.com/
Fetch time: Jun 20, 2018, 11:54 AM GMT+3
Device: Emulated Nexus 5X
Network throttling: 150 ms TCP RTT, 1,638.4 Kbps throughput (Simulated)
CPU throttling: 4x slowdown (Simulated)
User agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Generated by Lighthouse 3.0.0-beta.0
Related issues
Since LH does not register the service worker, PWA checklist fails. Extract from the "report":
Progressive Web App
These checks validate the aspects of a Progressive Web App, as specified by the baseline PWA Checklist.
1
Does not register a service worker
2
Does not respond with a 200 when offline
3
User will not be prompted to Install the Web App
Failures: Site does not register a service worker.
The text was updated successfully, but these errors were encountered: