Skip to content
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

Firestore WebChannelConnection 'Write' stream transport errored on Expo React Native – write fails in production #8864

Open
mmaxwell22 opened this issue Mar 25, 2025 · 4 comments

Comments

@mmaxwell22
Copy link

### Describe the bug
Firestore writes consistently fail on iOS (Expo Go and dev builds) with:

@firebase/firestore: Firestore (11.5.0): WebChannelConnection RPC 'Write' stream transport errored


This happens even after trying all known workarounds. I’m in **Newfoundland, Canada**, and suspect it may be regional or CDN-related.

---

### To Reproduce
Steps:

1. Using Expo SDK 50 / React Native
2. Firebase initialized with long polling:

```js
initializeFirestore(app, {
  experimentalForceLongPolling: true,
  useFetchStreams: false,
});
  1. Auth works fine. User signs in, UID retrieved.
  2. Write attempt:
await setDoc(doc(db, 'users', user.uid), {
  username: 'test',
  role: 'fan',
});
  1. Console error:
Firestore: WebChannelConnection RPC 'Write' stream transport errored

No success message, no write saved.


Expected behavior

Data should save without RPC transport failure.


Logs

@firebase/firestore: WebChannelConnection RPC 'Write' stream transport errored

Environment

  • Device: iPhone 14 and 15 (iOS)
  • Expo Go and Expo Dev Build
  • Firebase JS SDK: 11.5.0
  • Firestore region: nam5 (multi-region US)
  • Location: Canada (Newfoundland)

Tried Workarounds

  • experimentalForceLongPolling: true
  • useFetchStreams: false
  • setLogLevel('debug') shows streaming endpoint timeout
  • Using REST API works (via fetch) — confirms Auth + Rules are OK
  • Firestore rules:
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}
  • Restarted with expo start --clear
  • Tried both getFirestore and initializeFirestore separately

Additional context

We're building a music profile MVP. Auth works. Profile form works. But .setDoc(...) never saves. Likely WebChannel/CDN/region issue — can Firestore fallback to REST or newer fetch-based transport in mobile?


---




@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@cherylEnkidu
Copy link
Contributor

Hi @mmaxwell22,

Thank you for filling up the ticket! Other than the setDoc, could you please test if other firestore apis work or not? Also this error may cause by #8281 (comment) Could you please enable debug logging by calling setLogLevel('debug') for us to gather more information?

@patrickkeenan
Copy link

patrickkeenan commented Mar 28, 2025

I'm having this same problem when trying to use getDoc

@firebase/firestore: Firestore (11.5.0): WebChannelConnection RPC 'Listen' stream 0x2a0f18f9 transport errored:

Confirmed that using an older version fixes the issue. Really frustrating, I lost a day to this.

npm install [email protected]

@cherylEnkidu
Copy link
Contributor

Hi @patrickkeenan , could you please provide a minimum repo for the problem you are experiencing? Are you testing against emulator or prod? Which older version works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants