LoginSignup
4
1

More than 1 year has passed since last update.

react-native > firebase > While trying to resolve module `idb`

Posted at

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;

参考

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1