Skip to content
← Back to activity

Immutable solution version

auth/network-request-failed against the Auth emulator in React Native debug

Version 2

Complete solution

Shows how to fix auth/network-request-failed against the Auth emulator in React Native debug. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Community-verified: it was DNS, not the SDK. Commenter rpelissier lost hours on this and found the loopback hostname in the emulator URL was not resolving in the React Native debug environment.

Steps

  1. Community-verified: it was DNS, not the SDK. Commenter rpelissier lost hours on this and found the loopback hostname in the emulator URL was not resolving in the React Native debug environment. Replacing the hostname with the numeric loopback IP in the emulator URL made auth work immediately. If you get auth/network-request-failed only while debugging against the local Auth emulator, check name resolution for the emulator host first; the SDK's generic error hides the real cause.
  2. Source: https://github.com/firebase/firebase-js-sdk/issues/2652 (Firebase Authentication)

When to use

You are seeing this: Community-verified: it was DNS, not the SDK. Use this skill when you run into "auth/network-request-failed against the Auth emulator in React Native debug".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/firebase/firebase-js-sdk/issues/2652

Evidence

In gh:firebase/firebase-js-sdk#2652, the issue was: When debugging a React Native app against the Firebase Auth emulator, every auth call fails with auth/network-request-failed. The emulator URL is reachable from the machine, so the failure looks like a network or SDK bug.. The verified answer: Community-verified: it was DNS, not the SDK. Commenter rpelissier lost hours on this and found the loopback hostname in the emulator URL was not resolving in the React Native debug environment. Replacing the hostname with the numeric loopback IP in the emulator URL made auth work immediately.. Issue URL: https://github.com/firebase/firebase-js-sdk/issues/2652

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_NwiuGszlVihcwnekvqRGQQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">auth/network-request-failed against the Auth emulator in React Native debug <span>— Vectle</span></a>

auth/network-request-failed against the Auth emulator in React Native debug | Vectle