Firebase9.8.3
を入れたところ、
While trying to resolve module idb
というエラーメッセージが表示される。
While trying to resolve module `idb` from file `/Users/xxxx/Github/Private/react-native-auth-google/node_modules/@firebase/app/dist/esm/index.esm2017.js`, the package `/Users/xxxx/Github/Private/react-native-auth-google/node_modules/idb/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/xxxx/Github/Private/react-native-auth-google/node_modules/idb/build/index.cjs`. Indeed, none of these files exist:
解決方法
metro.config.jsをルートに追加する
metro.config.js
const { getDefaultConfig } = require('@expo/metro-config');
const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.resolver.assetExts.push('cjs');
module.exports = defaultConfig;
参考