这是我的第一个应用程序。我正在尝试使用Firebase进行电子邮件/密码认证。我按照基本教程https://firebase.google.com/docs/auth/web/password-auth#web-version-9操作,但我一直收到以下错误:
While trying to resolve module `idb` from file '.../node_modules/@firebase/app/dist/esm/index.esm2017.js', the package `/Users/##/##/##/node_modules/idb/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/##/##/##/node_modules/idb/build/index.cjs`.
我已将此添加到 metro.config.js 文件中:
resolver: {
sourceExts: ['jsx', 'js', 'ts', 'tsx', 'cjs'],
},
问题仍然存在。