I host reactjs pwa app on IIS Server.I got error as Service worker is not Supported by browser
Asked
Active
Viewed 839 times
1
-
The error clearly explains the problem is the browser, not IIS. Which browser and version are you using? Chrome for example doesn't allow unsecured service worker connections, making an exception for localhost – Panagiotis Kanavos Jan 09 '20 at 11:13
-
Does this answer your question? [Service worker is not supported in chrome (69.0.3497.81)](https://stackoverflow.com/questions/52269746/service-worker-is-not-supported-in-chrome-69-0-3497-81) – Panagiotis Kanavos Jan 09 '20 at 11:15
-
BTW you shouldn't be using HTTP in the first place. Most web projects redirect to https out of the box. How did you create the react application? – Panagiotis Kanavos Jan 09 '20 at 11:16
-
when i hit this url " https://localhost:8080/ " on another pcs that time i can not browse that site, its only run local machine using which i hosted site. – Priya Jan 09 '20 at 11:31
-
That's what `localhost` means - connect to the *local* host/machine. Use HTTPS. – Panagiotis Kanavos Jan 09 '20 at 11:53
1 Answers
0
Chrome needs service workers to be served over https (secure communication), but allows an exception for localhost for development. you can add your local address to Chrome by copy pasting below line to your chrome's address bar chrome://flags/#unsafely-treat-insecure-origin-as-secure and then add your IP address there, select enable from right hand side drop down and restart.

Ramin Ahmadi
- 619
- 5
- 13