- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在启动模拟器后遇到了这个错误,我在图像下添加了我的代码,并在终端上出现了错误。这是我的 App.js 文件 Error Image on Emulator
error: Error: While trying to resolve module
firebase
from file/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/index.js
, the package/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/node_modules/firebase/package.json
was successfully found. However, this package itself specifies amain
module field that could not be resolved (/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/node_modules/firebase/index
. Indeed, none of these files exist:
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
和
componentDidMount() {
const firebaseApp = initializeApp({
apiKey: "AIzaSyCpM2dwcUvJqVaKz856hz",
authDomain: "authentication-b4",
projectId: "authen",
storageBucket: "authenticat",
messagingSenderId: "7532",
appId: "1:753222",
measurementId: "G-"
});// I changed this, it isn't wrong
}
最佳答案
我在使用 expo 构建 React Native 应用时遇到了同样的问题
//package.json
"expo": "^44.0.0",
"firebase": "^9.8.1",
Metro has encountered an error: While trying to resolve module `idb` from file `/Users/cerebra/workspace/retailshake/recognizeReborn/node_modules/@firebase/app/dist/esm/index.esm2017.js`, the package `/Users/cerebra/workspace/retailshake/recognizeReborn/node_modules/idb/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/cerebra/workspace/retailshake/recognizeReborn/node_modules/idb/build/index.cjs`. Indeed, none of these files exist:
已修复为 downgrading firebase
//package.json
"firebase": "9.7.0",
关于reactjs - Metro 遇到错误 : While trying to resolve module 'firebase' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70398442/
我是一名优秀的程序员,十分优秀!