Skip to content

Firestore crashes after 10.7.1 -> 10.7.2 update in Expo/React Native #7962

Closed
@Yonom

Description

@Yonom

Operating System

iOS 17.2

Browser Version

React Native 0.73.2 / Hermes

Firebase SDK Version

10.7.2

Firebase SDK Product:

Firestore

Describe your project's tooling

React Native app initialized with Expo

Describe the problem

After upgrading to Firestore SDK 10.7.2, fetching documents from Firestore causes an error.

The crash occurs during the isSafari() call introduced in this commit: d7ace80#diff-d73aa623e0442e31903665f2d555bbf0e1a317db2009f526e8f7209ebf662917R66

This is because the isSafari() function from @firestore/utils accesses navigator.userAgent. On React Native, navigator.userAgent is undefined.

Steps and code to reproduce issue

@firebase/firestore: Firestore (10.7.2): INTERNAL UNHANDLED ERROR:  TypeError: Cannot read property 'includes' of undefined
    at isSafari
    at __PRIVATE_getDefaultRelativeIndexReadCostPerDocument
    at __PRIVATE_QueryEngine
    at createLocalStore

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions