From 3467483be993a65f76203400721dc07e0729cac3 Mon Sep 17 00:00:00 2001 From: Russell Wheatley Date: Wed, 16 Nov 2022 11:37:42 +0000 Subject: [PATCH] fix(auth, web): catch hot reload & hot restart exception for web emulator (#9601) --- .../firebase_auth_web/lib/firebase_auth_web.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart b/packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart index 7ef5524f7234..182ff3490dd1 100644 --- a/packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart +++ b/packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart @@ -437,7 +437,11 @@ class FirebaseAuthWeb extends FirebaseAuthPlatform { // origin as a single string delegate.useAuthEmulator('http://$host:$port'); } catch (e) { - throw getFirebaseAuthException(e); + final String code = (e as auth_interop.AuthError).code; + // this catches Firebase Error from web that occurs after hot reloading & hot restarting + if (code != 'auth/emulator-config-failed') { + throw getFirebaseAuthException(e); + } } }