'ReferenceError: Can't find variable: IDBIndex when using Firebase on Expo

I'm developing an app using Expo, using the Firebase JS SDK (https://docs.expo.io/guides/using-firebase/), only for Authentication and to use the Cloud Firestore Database. It works fine on browser but when I switch to Expo Go I get this error:

ReferenceError: Can't find variable: IDBIndex

It's my understanding that the Firebase SDK should work fine aside from when using Analytics, which I'm not using. I have spent hours googling this issue but most people refer to an issue with Analytics, so any help would be really appreciated!

My package.json:

"dependencies": {
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.4",
    "expo": "~41.0.0",
    "expo-status-bar": "~1.0.4",
    "firebase": "8.2.3",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
    "react-native-datefield": "^0.1.0",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-reanimated": "~2.1.0",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.0.0",
    "react-native-web": "~0.13.12"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0"
  }


Solution 1:[1]

I fixed this issue by using [email protected]. In the expo docs they mention that they are using this version in their example. https://docs.expo.dev/guides/using-firebase/

With newer versions of Firebase I encounter the same issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Frederik N