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-useerror 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.htmlfile also fails to create a user, producing the sameauth/network-request-failederror, indicating the issue is environmental and not specific to the React application code
Troubleshooting steps taken:
- Confirmed the correct
projectIdis being used and that the “Email/Password” sign-in provider is enabled. - Verified that error logging is correctly implemented with
try...catchblocks. - Attempted to force the emulator connection using various methods (
localhostcheck,import.meta.env.DEV, hardcoded connection,AuthProvidercontext) 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.