LoginSignup
0
0

More than 1 year has passed since last update.

firebasev9にアップデートした際、Expoからの"While trying to resolve module `idb` "のエラー解決方法

Last updated at Posted at 2022-12-24

Expo>React Nativeで、firebase@9.0.5にアップデートしたときに、idbファイルが見つけられないエラーが出た。

While trying to resolve module idb from file ~/node_modules/@firebase/app/dist/esm/index.esm2017.js, the package ~/node_modules/idb/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (~/node_modules/idb/build/index.cjs. Indeed, none of these files exist:

解決方法

ルートディレクトリにmetro.config.jsファイルを作成して、手動で.cjsをパースする設定を追加
metro.config.js
const { getDefaultConfig } = require("expo/metro-config");

const config = getDefaultConfig(__dirname);

config.resolver.assetExts.push("cjs");

module.exports = config;

参考

Metro Bundler

0
0
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
0
0