Angularfire: Service worker not registrated when importing firebase performences

Created on 12 Jun 2019  路  4Comments  路  Source: angular/angularfire

After i upgraded to angular 8 from 7 i added firebase performances to my app, then i noticed that the service worker doesn't register, then i started to play with new angular projects and i realize that even in a new blanc angular project if i'm adding service worker (with ng add @angular/pwa) and then adding firebase performances (with angularfire ng add @angular/fire) the service worker stop register but when i remove the performences module the sw start register again.

Version info

Angular: 8.0.0
Firebase: 6.1.1
AngularFire:5.2.1

Most helpful comment

Sounds like a zone instability, I'm also seeing this on one of my apps, I'll investigate this week and cut 5.2.2 with any fixes.

All 4 comments

Sounds like a zone instability, I'm also seeing this on one of my apps, I'll investigate this week and cut 5.2.2 with any fixes.

@Lagistos you can try using the new SwRegistrationOptions as a workaround.

I'm experiencing the same problem as a workaround I'm registering the service worker as soon as the app starts.

    ServiceWorkerModule.register('ngsw-worker.js', {
      enabled: environment.production,
      registrationStrategy: 'registerImmediately'
    })

But definitely this shouldn't be the final fix.

Zone.js issues should be addressed that were blocking ngsw.

Was this page helpful?
0 / 5 - 0 ratings