前提・実現したいこと
react-nativeでfirebaseとの接続を行なっていました。
iphone12 pro maxのexpo環境をupgradeしたら以下のようなエラーが出力されました。(upgrade直前までは動いていました)
Constantsがundefinedになってしまっているみたいで、
再度expo install expo-constansをしてもうまくいきませんでした。
解決策がわかる方がいましたら、コメントお願いします。
発生している問題・エラーメッセージ
✔ Expo Go on iPhone 12 Pro Max is outdated, would you like to upgrade? … yes /nstalling the Expo Go app on iPhone 12 Pro Max [===================== ] 37% 95.5 This download is taking longer than expected. You can also try downloading the clients from the website at https://expo.io/tools Installing the Expo Go app on iPhone 12 Pro Max [========================================================] 100% 0.0 Installing Expo Go 2.19.6 on iPhone 12 Pro Max Opening exp://127.0.0.1:19000 on iPhone 12 Pro Max Finished building JavaScript bundle in 53792ms. Running application on iPhone 12 Pro Max. TypeError: undefined is not an object (evaluating '_expoConstants.default.manifest.extra.firebase') at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0 at [native code]:null in flushedQueue at [native code]:null in invokeCallbackAndReturnFlushedQueue Unable to start your application. Please refer to https://expo.fyi/no-registered-application for more information. at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:200:6 in runApplication at [native code]:null in callFunctionReturnFlushedQueue
該当のソースコード
import * as firebase from "firebase"; import "firebase/firestore"; import Constants from "expo-constants"; import { Shop } from "../types/shops"; if (!firebase.apps.length) { firebase.initializeApp(Constants.manifest.extra.firebase); } export const getShops = async () => { const snapshot = await firebase.firestore().collection("shops").get(); const shops = snapshot.docs.map((doc) => doc.data() as Shop); return shops; };
あなたの回答
tips
プレビュー