preact-cli icon indicating copy to clipboard operation
preact-cli copied to clipboard

Service worker does not registered in production Firebase Hosting

Open zshanhui opened this issue 7 years ago • 2 comments

Do you want to request a feature or report a bug?

What is the current behaviour? The sw.js is not registering in production. Please look at the dropbox screenshots https://www.dropbox.com/s/l14n44w2ax7t6ws/Scrreenshot%202018-12-16%2023.44.16.png?dl=0 https://www.dropbox.com/s/jl95a6fdj22tlhm/Screenshot%202018-12-16%2023.48.02.png?dl=0

If the current behaviour is a bug, please provide the steps to reproduce. I developed the app, then yarn build and deployed to Firebase Hosting. Shows error in registering Uncaught (in promise) TypeError: Failed to fetch which isn't too helpful. And I can't try to fix this myself since the Service Worker is not generated by some template which I can modify. SW.js is not accessible, so not sure what to do.

What is the expected behaviour? The service worker should be working without any further modification automatically.

Please mention other relevant information.

  • Node version = v11.1.0
  • npm version = 6.5.0
  • Operating system = MacOS Sierra
  • CLI version = Firebase 6.0.1
  • Browser = Chrome 71

zshanhui avatar Dec 16 '18 15:12 zshanhui

hi can you post the network tab output to show which file is 404

prateekbh avatar Dec 17 '18 12:12 prateekbh

This is what I'm getting in the network tab...

Screen Shot 2019-03-11 at 17 00 54

liamthorpeyoung avatar Mar 11 '19 17:03 liamthorpeyoung