Skip to content
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

IndexedDb causing Lighthouse error #267

Open
marcusfrdk opened this issue Dec 24, 2020 · 1 comment
Open

IndexedDb causing Lighthouse error #267

marcusfrdk opened this issue Dec 24, 2020 · 1 comment

Comments

@marcusfrdk
Copy link

Hi, I've been trying to get a working NextJS PWA. Everything is working fine at random. Everything except the 'start_url does not respond with a 200 when offline.' works every time. However, at times and when clearing cache it works and results in a full Lighthouse score, but most often not. The applications works perfect offline when reloading and force reloading.

Tested sites

I got the same error on both sites.

Versions and Tested Browsers

MacOS: 10.15.7
Chrome: 87.0.4280.88 (Incognito & Normal)
Brave: 1.18.75 (Incognito & Normal)
NextJS: 10.0.4
Next-offline: 5.0.3
React: 17.0.1
Node: 15.0.1

Issue

GUESS: IndexedDb/workbox-expiration causes the browser to cache the website, making Lighthouse think that the SW is not working.

Screen Shot 2020-12-24 at 21 12 53

Screen Shot 2020-12-24 at 21 27 37

Screen Shot 2020-12-24 at 21 13 24

Screen Shot 2020-12-24 at 21 15 25

Reproduce

  1. Run Lighthouse with PWA option selected
  2. Everything will either work, or the 'start_url does not respond with 200 when offline' will be marked in red.
  3. Close lighthouse, go into the 'Applications' tab and delete the IndexedDb/workbox-expiration entry and then 'Clear Storage'
  4. Rerun test, and you might get full score.

My manifest.json

...
"start_url": "/",
"scope": "/"
...

Expected

To receive a full Lighthouse score every time.

Actual

Occationally receiving a full Lighthouse score, but more often getting a 'start_url does not respond with a 200 when offlineThe start_url did respond, but not via a service worker.' error in the PWA LH test.

Epilogue

I really love this project, it's super simple to use with NextJS. Thank you for creating it!
This might not even be a problem. But I guess Lighthouse should not throw errors when the service worker actually works.

@aneenajohn
Copy link

I am having the same issues now. Is there any workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants