'Firebase: The popup has been closed by the user before finalizing the operation. (auth/popup-closed-by-user

Im add an sign up with google button using firebase and then i click on it and choose an account, it works, but then a click on exit button in popup window, it crashes with this "Firebase: The popup has been closed by the user before finalizing the operation. (auth/popup-closed-by-user" error.

here is error description:

  119 |   fullParams[0].appName = authOrCode.name;
  120 | }
  121 | 
> 122 | return (authOrCode as AuthInternal)._errorFactory.create(
      | ^  123 |   code,
  124 |   ...fullParams
  125 | );



  80 |   authOrCode: Auth | K,
  81 |   ...rest: unknown[]
  82 | ): FirebaseError {
> 83 |   return createErrorInternal(authOrCode, ...rest);
  84 | }
  85 | 
  86 | export function _errorWithCustomMessage(auth: Auth, code: AuthErrorCode, message: string): FirebaseError {



  280 | // call could still be in flight.
  281 | this.pollId = window.setTimeout(() => {
  282 |   this.pollId = null;
> 283 |   this.reject(
      | ^  284 |     _createError(this.auth, AuthErrorCode.POPUP_CLOSED_BY_USER)
  285 |   );
  286 | }, _Timeout.AUTH_EVENT);


Solution 1:[1]

I had this error message when I had my browser popup-blocker enabled.

I disabled my popup blocker (I'm using Brave browser so I actually set it to 'Shields down for this site') and it worked for me.

Solution 2:[2]

I had the same problem with Firebase auth in dev mode. The problem is due to some incorrect cors setting in my local dev server.

Try go to networks on chrome and see if there is any cors-related error. If so, the solution is to remove any cors related setting on your local dev-server.

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 OBEY
Solution 2 Antonio Cao