tools: Generated SW breaks on Firebase hosting

Running locally with polymer serve works fine. But if I deploy and check out the version on firebase hosting, when I click sign in, it opens the OAuth window (which is blank), sits there for a little while, then closes the OAuth window and logs:

polymer-micro.html:1 Uncaught TypeError: Cannot read property 'instanceCount' of undefinedcreatedCallback @ polymer-micro.html:1
firebase.js:3 Uncaught Error: Network Error

Only way to fix it is to go into the Applications panel in DevTools and set Bypass for network to tell the SW to not intercept requests on the page.

My suspicion is when the OAuth window opens, the SW is jumping in and trying to handle things. I’ve actually randomly seen the site get served into the window that was spawned to display the OAuth sign in

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (16 by maintainers)

Commits related to this issue

Most upvoted comments

So should sw-precache-config.js for Firebase Hosting look like this?

sw-precache-config.js

module.exports = {
  staticFileGlobs: [
    '/index.html',
    '/manifest.json',
    '/bower_components/webcomponentsjs/webcomponents-lite.min.js'
  ],
  navigateFallback: '/index.html',
  navigateFallbackWhitelist: [/^(?!\/__)/]
};