'Firebase error "auth/argument-error" when trying to sign in with Google/Facebook

Below is the relevant code. The error auth/argument-error is thrown when the method signInWithPopup gets called:

import { AngularFireAuth } from "@angular/fire/compat/auth";
import firebase from "firebase/compat/app";
import "firebase/compat/auth";

constructor(
    private afAuth: AngularFireAuth,
  ) { }

async socialSignIn(providerName: "google" | "facebook") {
    const authProvider =
      providerName === "google"
        ? new firebase.auth.GoogleAuthProvider()
        : new firebase.auth.FacebookAuthProvider();
    return this.afAuth.signInWithPopup(authProvider);
  }

The relevant dependencies:

"firebase": "9.6.9",
"@angular/fire": "7.3.0",

And I'm using Angular 13. Any idea why this is happening? The error is not very useful.



Solution 1:[1]

Reverting to @angular/[email protected] has stopped this error from happening for me with Angular 13, firebase 9.8.1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DeC