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.

Firebase throwing auth/internal-error when initializing without the Internet connection

See original GitHub issue

Hello

I’ve run into a problem when testing PWA app in offline mode. Everything works fine if app started with the Internet access and lost if afterwords. However if I refresh the page in the offline mode I get :

polyfills.a335baf6bc37129f.js:1 Unhandled Promise rejection: Firebase: Error (auth/internal-error). ; Zone: <root> ; Task: HTMLScriptElement.addEventListener:error ; Value: FirebaseError: Firebase: Error (auth/internal-error).

There is nothing happening in the component apart from being injected in the constructor.

export class CheckinComponent implements OnInit {

  constructor(private firestore: AngularFirestore) { }

  ngOnInit(): void {
  }

  submit(): void {  }

}

In my app module I have following code:

import {MaterialModule} from './material-module';
import { HistoryComponent } from './components/history/history.component';
@NgModule({
  declarations: [
    AppComponent,
    CheckinComponent,
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    ReactiveFormsModule,
    MaterialModule,
    AngularFireModule.initializeApp(environment.firebase),
    AngularFirestoreModule.enablePersistence(),
    ServiceWorkerModule.register('ngsw-worker.js', {
      enabled: environment.production,
      // Register the ServiceWorker as soon as the app is stable
      // or after 30 seconds (whichever comes first).
      registrationStrategy: 'registerWhenStable:30000'
    })
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Version info

Angular:13.0.0

Firebase:9.4.0

AngularFire:7.2.0

Other (e.g. Ionic/Cordova, Node, browser, operating system):

"dependencies": {
    "@angular/animations": "~13.0.0",
    "@angular/cdk": "^13.0.2",
    "@angular/common": "~13.0.0",
    "@angular/compiler": "~13.0.0",
    "@angular/core": "~13.0.0",
    "@angular/fire": "^7.2.0",
    "@angular/forms": "~13.0.0",
    "@angular/material": "^13.0.2",
    "@angular/platform-browser": "~13.0.0",
    "@angular/platform-browser-dynamic": "~13.0.0",
    "@angular/router": "~13.0.0",
    "@angular/service-worker": "~13.0.0",
    "firebase": "^9.4.0",
    "rxfire": "^6.0.0",
    "rxjs": "~7.4.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  }

Debug output

** Errors in the JavaScript console **

polyfills.a335baf6bc37129f.js:1 Unhandled Promise rejection: Firebase: Error (auth/internal-error). ; Zone: <root> ; Task: HTMLScriptElement.addEventListener:error ; Value: FirebaseError: Firebase: Error (auth/internal-error).
    at cs (main.1e8dbe96f9208f40.js:1)
    at Rn (main.1e8dbe96f9208f40.js:1)
    at HTMLScriptElement.E.onerror [as __zone_symbol__ON_PROPERTYerror] (main.1e8dbe96f9208f40.js:1)
    at HTMLScriptElement.qe (polyfills.a335baf6bc37129f.js:1)
    at T.invokeTask (polyfills.a335baf6bc37129f.js:1)
    at I.runTask (polyfills.a335baf6bc37129f.js:1)
    at m.invokeTask [as invoke] (polyfills.a335baf6bc37129f.js:1)
    at S (polyfills.a335baf6bc37129f.js:1)
    at HTMLScriptElement.D (polyfills.a335baf6bc37129f.js:1) FirebaseError: Firebase: Error (auth/internal-error).
    at cs (http://localhost:8000/main.1e8dbe96f9208f40.js:1:71345)
    at Rn (http://localhost:8000/main.1e8dbe96f9208f40.js:1:70809)
    at HTMLScriptElement.E.onerror [as __zone_symbol__ON_PROPERTYerror] (http://localhost:8000/main.1e8dbe96f9208f40.js:1:137312)
    at HTMLScriptElement.qe (http://localhost:8000/polyfills.a335baf6bc37129f.js:1:11454)
    at T.invokeTask (http://localhost:8000/polyfills.a335baf6bc37129f.js:1:7145)
    at I.runTask (http://localhost:8000/polyfills.a335baf6bc37129f.js:1:2540)
    at m.invokeTask [as invoke] (http://localhost:8000/polyfills.a335baf6bc37129f.js:1:8196)
    at S (http://localhost:8000/polyfills.a335baf6bc37129f.js:1:20140)
    at HTMLScriptElement.D (http://localhost:8000/polyfills.a335baf6bc37129f.js:1:20384)

Expected behavior

Initialize Firebase

Actual behavior

Error message. Firebase do not work.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

2reactions
vnorbixcommented, Jan 26, 2022

It works fine for me after updating firebase to latest version, 9.6.4 as of now.

0reactions
riwoscommented, Jan 26, 2022

@vnorbix I’ll check and let it know here wheter upgrade to another version of firebase works for me as well. However thanks that you left a comment 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Admin Authentication API Errors | Firebase - Google
auth/insufficient-permission, The credential used to initialize the Admin SDK has insufficient permission to access the requested Authentication resource.
Read more >
Firebase admin().auth().getUser(uid) internal error
It uses authenticationMiddleware to check for a cookie with idToken, and if it exists, then to decode the token and fetch the user's...
Read more >
Troubleshoot Cloud Run issues
This error occurs when an application has an established TCP connection with a peer across the network and that peer unexpectedly closes the...
Read more >
System.AggregateException Firebase - Unity Forum
AggregateException: Exception of type 'System.AggregateException' was thrown. ... Firebase.FirebaseException: An internal error has occurred, ...
Read more >
CommonStatusCodes | Google Play services
This constant is deprecated. This case handled during connection, not during API requests. No results should be returned with this status code.
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