question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ApplicationRef.isStable never goes to "true" when an instance of AngularFireAuth is injected

See original GitHub issue

When AngularFireAuth is injected anywhere on the page, the ApplicationRef.isStable never emits true. This causes problems with latest @angular/service-worker, which relies on ApplicationRef.isStable to install the worker. This probably also would cause server-side rendering to timeout, but I didn’t test this.

Version info

Angular: 5.0.0

Firebase: 4.6.2

AngularFire: 5.0.0-rc4

How to reproduce these conditions

Inject AngularFireAuth into a component and subscribe to the ApplicationRef.isStable observable:

import { Component, ApplicationRef, ChangeDetectorRef } from '@angular/core';
import { AngularFireAuth } from 'angularfire2/auth';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  constructor(appRef: ApplicationRef, af: AngularFireAuth) {    
    appRef.isStable.subscribe(s => {
      console.log(s); 
    });
  }
}

Here is a project that reproduces the problem: https://stackblitz.com/edit/angularfire2-appref-isstable

Expected behavior

The ApplicationRef.isStable observable should emit true shortly after application is loaded.

Actual behavior

The ApplicationRef.isStable observable emits only initial false value.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:15
  • Comments:25 (10 by maintainers)

github_iconTop GitHub Comments

11reactions
deftomatcommented, Dec 11, 2017

The same issue when I injects AngularFirestore. We cannot use an @angular/service-worker as it is not registered due to this issue.

6reactions
patrickmichalinacommented, Jan 14, 2018

Any updates on this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Demystifying the ApplicationRef.IsStable event in Angular
IsStable event is a notifier. whenever an application goes from one state to another, it gives us an appropriate value: True=Stable , False=Unstable...
Read more >
ApplicationRef - Angular
In this example, isStable will never emit true , and the trace "App is stable now" will never get logged. If you want...
Read more >
ApplicationRef.isStable not executing - Stack Overflow
isStable never fires and, therefore, the second console.log never writes to the console. Am I doing this right, or am I missing something?...
Read more >
Create Responsive, Fast and Reliable PWAs Using Angular
While the advice and information in this book are believed to be true and accurate at ... I am going to cover building...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found