firebase / firebase/firebase-admin-node
Cannot find module '@firebase/logger' or its corresponding type declarations
- Ngôn ngữ chính
- TypeScript
- Star
- 1.7k
- Fork
- 419
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 16
Mô tả
### [READ] Step 1: Are you in the right place?
**Cloud Firestore support is provided by the [`@google-cloud/firestore`](https://npmjs.com/package/@google-cloud/firestore) library. Therefore the easiest and most efficient way to get Firestore issues resolved is by directly reporting them at the [nodejs-firestore](https://github.com/googleapis/nodejs-firestore) GitHub repo.**
If you still think the problem is related to the code in this repository, then read on.
* For issues or feature requests related to __the code in this repository__
file a Github issue.
* For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/)
with the firebase tag.
* For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk)
google group.
* For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
[Firebase support channel](https://firebase.google.com/support/).
### [REQUIRED] Step 2: Describe your environment
* Operating System version: macOS Ventura 13.1
* Firebase SDK version: v11.5.0
* Firebase Product: Firestore
* Node.js version: v16.19.0
* NPM version: v8.19.3
### [REQUIRED] Step 3: Describe the problem
#### Steps to reproduce:
Execute `yarn build` in the project firebase-admin SDK has installed.
#### Relevant Code:
```TypeScript
app.listen(app.get('port'), async () => {
try {
firebaseAdmin.initializeApp({
credential: firebaseAdmin.credential.cert({
projectId: env.FIREBASE.project_id,
clientEmail: env.FIREBASE.client_email,
privateKey: env.FIREBASE.private_key,
}),
});
...
} catch (err) {
console.error(err);
}
});
```
#### Error message:
```
.yarn/cache/@firebase-app-types-npm-0.9.0-c08aff84f3-e79bd3c4a8.zip/node_modules/@firebase/app-types/index.d.ts:17:57 - error TS2307: Cannot find module '@firebase/logger' or its corresponding type declarations.
```
This issue reproduced after migrating npm to yarn. It was ok with `npm build`.
Hướng dẫn đóng góp
Hướng nghiên cứu
Tái hiện lỗi bằng cách chạy `yarn build` trong một project đã cài đặt Firebase Admin SDK, sau đó so sánh với `npm build`. Điều tra lỗi khai báo `@firebase-app-types` được báo cáo và xác định cần những gì để TypeScript resolve được `@firebase/logger`; hoàn thành khi bản build bằng Yarn kết thúc mà không có TS2307.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- nodejs, typescript
- Lĩnh vực
- backend, build-system
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100