angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.67k stars 2.19k forks source link

Service worker not registrated when importing firebase performences #2110

Closed Lagistos closed 3 years ago

Lagistos commented 5 years ago

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

jamesdaniels commented 5 years ago

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.

Splaktar commented 5 years ago

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

marianocodes commented 5 years ago

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.

jamesdaniels commented 3 years ago

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