简体   繁体   English

无法从“node_modules\@firebase\app\dist\esm\index.esm2017.js”解析“idb”

[英]Unable to resolve "idb" from "node_modules\@firebase\app\dist\esm\index.esm2017.js"

i am facing a problem since past days, and not able to solve it can anyone help me slight to make it work efficiently我从过去几天开始就面临一个问题,并且无法解决它,任何人都可以帮助我让它有效地工作

Moreover also have degraded firebase to 9.6.11 as per other solutions on similar site.此外,还按照类似站点上的其他解决方案将 firebase 降级到 9.6.11。


import firebase from "firebase/compat/app";
import "firebase/compat/auth";
import "firebase/compat/firestore";

// Your web app's Firebase configuration
const firebaseConfig = {
  apiKey: ".......................",
  authDomain: ".......................",
  projectId: ".......................",
  storageBucket: ".......................",
  messagingSenderId: ".......................",
  appId: "......................."
};

// Initialize Firebase
let app;
if (firebase.apps.length === 0) {
  app = firebase.initializeApp(firebaseConfig);
} else {
  app = firebase.app()
}

const auth = firebase.auth()

export { auth };````

there's an issue open on the metro repo facebook/metro#535 Metro repo facebook/metro#535上存在一个问题

builds work fine again for me after adding this to my metro config:将其添加到我的 Metro 配置后,构建对我来说再次正常工作:

resolver: {
    sourceExts: ['js', 'json', 'ts', 'tsx', 'cjs'],
  },

the issue is solved thanks问题解决了 谢谢

By adding通过添加

const { getDefaultConfig } = require("@expo/metro-config");

const defaultConfig = getDefaultConfig(__dirname);

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

module.exports = defaultConfig;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 node_modules 导入 firebase 不起作用 - Importing firebase from node_modules not working Expo Firebase 身份验证“尝试从文件中解析模块 `idb` 时” - Expo Firebase Authentication "While trying to resolve module `idb` from file" Firebase 部署错误 - 缺少 node_modules? - Firebase deploy error - node_modules missing? Angular 13:命名空间“/node_modules/firebase/compat/index”没有导出成员“用户”。 ts(2694) - Angular 13: Namespace '"/node_modules/firebase/compat/index"' has no exported member 'User'. ts(2694) firebase-js-sdk v9 不适用于本机反应? 错误:尝试解析模块“idb”时 - firebase-js-sdk v9 doesn't work with react native? Error: While trying to resolve module `idb` React Native 无法从“firebase.js”解析“firebase” - React Native Unable to resolve "firebase" from "firebase.js" 从 Node js 调用 Flutter web 应用程序 function ZBF12E1515C25C7D8A15AB2F14Z13 - Call Flutter web app from Node js function firebase 无法解析 firebase 中的符号 storageRef - Unable to resolve symbol storageRef in firebase 无法从 App Engine 中的 Node JS 连接到 Cloud MySQL - Unable to connect to Cloud MySQL from Node JS in App Engine 错误:TypeScript /home/runner/work/avi/avi/node_modules/@types/react-router/index.d.ts(149,100) 中的错误:预期类型。 TS1110 - Error: TypeScript error in /home/runner/work/avi/avi/node_modules/@types/react-router/index.d.ts(149,100): Type expected. TS1110
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM