trying to use firebase-js-sdk v9 for my react-native project but app build fails due to the following idb related error. Does anyone know anything about this issue?
CodePudding user response:
I downgraded firebase version to v9.6.1 which works fine.
CodePudding user response:
If you are using expo, 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;
React Native cli
const { getDefaultConfig } = require("metro-config");
const { resolver: defaultResolver } = getDefaultConfig.getDefaultValues();
exports.resolver = {
...defaultResolver,
sourceExts: [
...defaultResolver.sourceExts,
"cjs",
],
};