-
Notifications
You must be signed in to change notification settings - Fork 1k
Cannot connect to Auth Emulator more than once #8128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reaching out, @tzappia. It seems like the error is thrown here. From what I can gather, when the JavaScript SDK has made a request to the emulator(initialized a connection), trying to call I’m able to reproduce the error from the sample by commenting out the condition that checks if the connection to the emulator has been initialized: // if ((auth as any)._canInitEmulator && environment.emulatorPorts?.auth) {
connectAuthEmulator(
auth,
`http://localhost:${environment.emulatorPorts.auth}`,
{ disableWarnings: true }
);
// } Since the error is coming from the client SDK, I’d recommend filing an issue to the Firebase JavaScript SDK repository so that they can take a look. |
Thanks for investigating @aalej . It seems there was an existing bug open for this issue since 2022. I think it may be more of a problem now that SSR is gaining traction. I think it's a bad sign that the AngularFire put in a hack for it and that they haven't coordinated with the Firebase team to figure out a resolution. Are you able to bump the old bug report in the JS SDK repo with someone internally so it doesn't stay lost? Will it get more attention if I just open a brand new bug report? |
Thanks for sharing that issue @tzappia. I agree with you here, since SSR application are becoming more popular, I do see this causing some issues when trying to use the emulators. Reading through the bug, I think the proposed solution was exposing a Let me try to ping some folks to see what we can do here. |
[REQUIRED] Environment info
firebase-tools: 13.29.1
Platform: macOS
[REQUIRED] Test case
Initialize the Auth Emulator as part of a server side rendering flow using FirebaseServerApp. A sample app is provided with the latest release of AngularFire.
[REQUIRED] Steps to reproduce
In an environment using emulators, initialize the app, authenticate, and then reload the page.
[REQUIRED] Expected behavior
No errors should be observed when reloading the page.
[REQUIRED] Actual behavior
The app crashes with the error:
auth/emulator-config-failed
Additional notes
I see that in the AngularFire sample app, they have included this check to ensure the emulator doesn't get initialized twice.
This is a workaround that shouldn't have to rely on internal properties. Other emulators (Storage, Firestore, etc.) are able to be connected to multiple times successfully without error.
The text was updated successfully, but these errors were encountered: