My React application is unable to create users with Firebase Authentication when running in a Google Cloud Workstations development environment. The application seems to fail to connect to the local Auth emulator, and the fallback attempt to connect to the live Firebase backend is blocked, resulting in an auth/network-request-failed
error.
- When using the app’s sign-up form, the UI redirects as if the sign-up were successful, but no user account is created in either the local emulator UI or the live Firebase project console.
- An
auth/email-already-in-use
error is correctly thrown when using an existing email, proving a connection to the live backend is possible for some operations. - A minimal, non-React
test.html
file also fails to create a user, producing the sameauth/network-request-failed
error, indicating the issue is environmental and not specific to the React application code
Troubleshooting steps taken:
- Confirmed the correct
projectId
is being used and that the “Email/Password” sign-in provider is enabled. - Verified that error logging is correctly implemented with
try...catch
blocks. - Attempted to force the emulator connection using various methods (
localhost
check,import.meta.env.DEV
, hardcoded connection,AuthProvider
context) without success. - The network error persists across different browsers (Edge, Chrome) and different networks (primary network and mobile hotspot), pointing to a local machine or IDX environment issue.
- Temporarily disabling local firewall and antivirus software did not resolve the issue.