小编Eco*_*iny的帖子

Firebase: "Pending promise was never set" on sign in with popup

I'm using firebase auth in my application and am implementing other providers, in this case microsoft. Email/password works fine (app is initialised etc.) but trying signInWithPopup, as shown below:

import * as firebaseAuth from 'firebase/auth';

export function signupWithMicrosoft(): Promise<firebaseAuth.UserCredential> {
  const auth = firebaseAuth.getAuth();
  const provider = new firebaseAuth.OAuthProvider('microsoft.com');
  return firebaseAuth.signInWithPopup(auth, provider).catch(Promise.reject);
}
Run Code Online (Sandbox Code Playgroud)

fails inconsistently with:

Uncaught (in promise) Error: INTERNAL ASSERTION FAILED: Pending promise was never set
    debugFail assert.ts:256
    debugAssert assert.ts:271
    reject abstract_popup_redirect_operation.ts:135
    onAuthEvent abstract_popup_redirect_operation.ts:104
    sendToConsumer auth_event_manager.ts:97
    onEvent …
Run Code Online (Sandbox Code Playgroud)

javascript firebase firebase-authentication

8
推荐指数
1
解决办法
4063
查看次数