I would like to know if it' s possible to test pwa and register the serviceworker during the dev mode ( not production)
As when i make the ng build --prod then launchhttp-server in the dist folder it works fine, but then when i do ng serve without the build it gives me the chrome error: Service Worker failed to register
Are the procedures same on prod and dev ? as with lighthouse, the audit gives me ok on serviceworker on prod but not in dev for the same project
Any helps or links would be appreciate
Thanks
This question is 2 years old but I see it wasn't answered.
You cannot run service worker with ng server. As you mentioned, it works using http-server. This is by design. See Angular documentation here.
However, if you are not testing specific service worker functionality, such as retrieving data from cache if offline, your application will still function using ng serve, including retrieving data via http.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With