Skip to content

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

@mmaxwell22

Description

@mmaxwell22
### 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?


---




Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions