Expo+Firebase交互异常:Promise拒绝及Firestore断言失败排查
Expo + Firebase 交互失败问题
近期开发的Expo集成Firebase应用无法完成登录、注册等交互,持续抛出以下错误:
WARN Possible Unhandled Promise Rejection (id: 1): TypeError: Cannot read property 'includes' of undefined TypeError: Cannot read property 'includes' of undefined at isSafari (http://192.168.1.11:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true:214158:53) at __PRIVATE_getDefaultRelativeIndexReadCostPerDocument (http://192.168.1.11:8081/node_modules/expo- ERROR [2024-01-30T12:31:02.312Z] @firebase/firestore: Firestore (10.7.2): FIRESTORE (10.7.2) INTERNAL ASSERTION FAILED: Unexpected state ERROR [Error: FIRESTORE (10.7.2) INTERNAL ASSERTION FAILED: Unexpected state] ERROR [2024-01-30T12:31:02.333Z] @firebase/firestore: Firestore (10.7.2): FIRESTORE (10.7.2) INTERNAL ASSERTION FAILED: Unexpected state LOG [Error: FIRESTORE (10.7.2) INTERNAL ASSERTION FAILED: Unexpected state]
项目的package.json配置如下:
{ "name": "my-app", "version": "1.0.0", "main": "expo-router/entry", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "test": "jest --watch --coverage=false --changedSince=origin/main", "testDebug": "jest -o --watch --coverage=false", "testFinal": "jest", "updateSnapshots": "jest -u --coverage=false" }, "jest": { "preset": "jest-expo", "transformIgnorePatterns": [ "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)" ], "transform": {} }, "dependencies": { "@babel/plugin-proposal-export-namespace-from": "^7.18.9", "@gorhom/bottom-sheet": "^4", "@pietile-native-kit/page-slider": "^1.2.0", "@react-native-async-storage/async-storage": "1.18.2", "@react-native-community/datetimepicker": "7.2.0", "@shopify/flash-list": "1.4.3", "@types/jest": "^29.5.11", "@types/recoil": "^0.0.9", "expo": "^49.0.21", "expo-checkbox": "~2.4.0", "expo-constants": "~14.4.2", "expo-font": "~11.4.0", "expo-image": "~1.3.5", "expo-image-manipulator": "~11.3.0", "expo-image-picker": "~14.3.2", "expo-linear-gradient": "~12.3.0", "expo-linking": "~5.0.2", "expo-localization": "~14.3.0", "expo-router": "^2.0.14", "expo-status-bar": "~1.6.0", "firebase": "^10.7.1", "i18n-js": "^4.2.0", "jest": "^29.2.1", "jest-expo": "~49.0.0", "lottie-react-native": "5.1.6", "nativewind": "^2.0.11", "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.72.6", "react-native-element-dropdown": "^2.10.1", "react-native-gesture-handler": "~2.12.0", "react-native-gifted-chat": "^2.4.0", "react-native-google-places-autocomplete": "^2.5.6", "react-native-maps": "1.7.1", "react-native-reanimated": "~3.3.0", "react-native-safe-area-context": "4.6.3", "react-native-screens": "~3.22.0", "react-native-shimmer-placeholder": "^2.0.9", "react-native-svg": "13.9.0", "react-native-toast-message": "^2.2.0", "react-native-web": "~0.19.6", "recoil": "^0.7.7" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-typescript": "^7.23.3", "@expo/webpack-config": "^19.0.0", "@testing-library/react-native": "^12.4.3", "@types/react": "~18.2.14", "@types/react-native": "^0.72.8", "tailwindcss": "3.3.2", "typescript": "^5.1.3" }, "private": true }
已尝试升级Expo SDK到50版本、调整配置,均未解决问题,寻求可行解决方案。
内容的提问来源于stack exchange,提问作者Kony
相关产品推荐
相关产品推荐

