preact-cli: sw-cache not working (for offline use)

Is it intentional that sw cache doesn’t work out of the box?

I did preact create my-great-app, build the project using npm run build and serve build/ using php simple server.

I visit my localhost, the site is up, I can see the code to register service worker in /bundle.js but the registration code wasn’t executed. However, it works if i manually register it again, i.e. by executing navigator.serviceWorker.register('/sw.js', { scope: '/' }); in browser console.

I’m using Opera 45 in OSX.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 30 (19 by maintainers)

Most upvoted comments

@prateekbh No, it’s done & included for you. Check it out! 🎉

^agreed to @NekR