Skip to content

Commit 3467483

Browse files
fix(auth, web): catch hot reload & hot restart exception for web emulator (#9601)
1 parent af18b0b commit 3467483

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/firebase_auth/firebase_auth_web/lib/firebase_auth_web.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,11 @@ class FirebaseAuthWeb extends FirebaseAuthPlatform {
437437
// origin as a single string
438438
delegate.useAuthEmulator('http://$host:$port');
439439
} catch (e) {
440-
throw getFirebaseAuthException(e);
440+
final String code = (e as auth_interop.AuthError).code;
441+
// this catches Firebase Error from web that occurs after hot reloading & hot restarting
442+
if (code != 'auth/emulator-config-failed') {
443+
throw getFirebaseAuthException(e);
444+
}
441445
}
442446
}
443447

0 commit comments

Comments
 (0)