ipfs-shipyard / service-worker-gateway-2019-poc

[ARCHIVED] 2019 PoC of IPFS gateway fully running on a Service Worker. For modern (2024+) version see https://github.com/ipfs-shipyard/service-worker-gateway
MIT License
61 stars 11 forks source link

TypeError: navigator.serviceWorker is undefined #28

Closed renne closed 5 years ago

renne commented 5 years ago

Hi,

I'm new to service-workers. When I load service-worker-gateway/example/public/index.html from harddisk in Firefox 62.0.2 I get the following error message in the web.console:

TypeError: navigator.serviceWorker is undefined[Weitere Informationen] bundle.js:90982:1
<anonym>
file:///home/renne/Dokumente/Development/IPFS/service-worker-gateway/example/public/bundle.js:90982:1
__webpack_require__
file:///home/renne/Dokumente/Development/IPFS/service-worker-gateway/example/public/bundle.js:20:12
<anonym>
file:///home/renne/Dokumente/Development/IPFS/service-worker-gateway/example/public/bundle.js:66:18
<anonym>
file:///home/renne/Dokumente/Development/IPFS/service-worker-gateway/example/public/bundle.js:1:11
Source-Map-Fehler: TypeError: NetworkError when attempting to fetch resource.
Ressourcen-Adresse: file:///home/renne/Dokumente/Development/IPFS/service-worker-gateway/example/public/bundle.js
Source-Map-Adresse: server.js.map

Does anyone have an idea what's going wrong?

vasco-santos commented 5 years ago

Hello @renne

Can you provide me the steps you made, in order to have the example running? From what I understood, you accessed directly the example index.html directly with Firefox.

You should use a simple web server like http-server to serve the public folder:

http-serve public

And then access it using firefox. I tried it now using 62.0.2 (64-bit) and it worked fine for me

vasco-santos commented 5 years ago

I will close this issue, as there is no activity. @renne if you still have this problem, feel free to rebump it.

agnelvishal commented 5 years ago

ServiceWorker won't work in private mode https://stackoverflow.com/questions/38255482/pushpad-error-on-firefox-47-navigator-serviceworker-is-undefined