firebase / firebase/firebase-admin-node
Cannot find module '@firebase/logger' or its corresponding type declarations
- 主要语言
- TypeScript
- 星标
- 1.7k
- 派生
- 419
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 16
描述
### [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`.
贡献指南
调研方向
在安装了 Firebase Admin SDK 的项目中运行 `yarn build` 以重现失败,然后将其与 `npm build` 进行比较。调查报告的 `@firebase-app-types` 声明错误,并确定 TypeScript 解析 `@firebase/logger` 所需的条件;完成标准是 Yarn 构建在没有 TS2307 的情况下完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- nodejs, typescript
- 领域
- backend, build-system
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100