9

My Problem: I am trying to setup Progressive Web App for my site but my Manifest.json file's installability shows "Page does not work offline"

enter image description here

I tried to find what's causing this but couldn't. Can someone shed some light into this?

Souvik
  • 131
  • 1
  • 8
  • You are providing limited information, Can you show us your manifest code, your console, rest of the manifest view on devtools. – Emmanuel Aug 17 '19 at 23:07
  • The Chrome Lighthouse tool may give you more info and some hints. You are attempting this on an HTTPS url? – Mathias Aug 18 '19 at 01:28

3 Answers3

16

Your service worker might not have event listener for fetch event. Which is basic requirement for PWA.

Just add:

 self.addEventListener('fetch',() => console.log("fetch"));

to your service worker or add fetch listener according to your requirement.

To get more info follow: https://developers.google.com/web/ilt/pwa/lab-caching-files-with-service-worker#3_serve_files_from_the_cache

ata
  • 3,398
  • 5
  • 20
  • 31
kumudgupta76
  • 354
  • 3
  • 10
3

Your site doesn't install a service worker. Without a service worker offline will not work.

abraham
  • 46,583
  • 10
  • 100
  • 152
-1

I had similar issue with service worker and the latest Chrome add "offline_enabled": true to manifest.json to solve it

Tony Air
  • 1
  • 2