This is my first app. I'm trying to use Firebase for Email/Password authentication. I followed the basic tutorial https://firebase.google.com/docs/auth/web/password-auth#web-version-9, and I keep getting this error:
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`.
I've added this to metro.config.js:
resolver: {
sourceExts: ['jsx', 'js', 'ts', 'tsx', 'cjs'],
},
and the issue is still there.
To resolve this issue, create a metro.config.js file in the project root. In the file add the file extension cjs. details
const { getDefaultConfig } = require("@expo/metro-config");
const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.resolver.assetExts.push("cjs");
module.exports = defaultConfig;
ScreenShot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With