Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`ng add @angular/fire` stops with `Cannot read properties of undefined (reading 'email')` on firebase-tools 15

オープン
#3,768 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
angular, firebase, typescript
領域
cli

調査の方向性

Start with src/schematics/setup/prompts.ts:110 and src/schematics/setup/index.ts:95, then inspect src/schematics/firebaseTools.ts:30 and reproduce with firebase-tools 15. Add coverage for the version 15 login shape and ensure setup proceeds through the account, project and app questions without writing errors.

索引モデルが issue の本文から書いたものです。

説明

comp: schematics type: bug version: current (v17+)

ng add @angular/fire fails for anyone whose Firebase CLI is version 15, which is what npm installs today.

Reproduction

In an Angular 21 application with firebase-tools 15.28.1 resolvable, run ng add @angular/fire@next and pick any feature. Setup prints:

Using firebase-tools version 15.28.1
Cannot read properties of undefined (reading 'email')

It stops there, before the account, project and app questions, so nothing is written to the workspace.

Cause

userPrompt in src/schematics/setup/prompts.ts:110 reads defaultUser.email, where defaultUser comes from await firebaseTools.login(options).

  • Called inside a terminal, that call returns an object carrying email on firebase-tools 14.27.0 and returns undefined on 15.28.1, so the read throws.
  • src/schematics/setup/index.ts:95 reads user.email from the same source and has the same exposure.
Who hits it

Everyone with firebase-tools 15 installed, and everyone with no Firebase CLI at all:

  • src/schematics/firebaseTools.ts:30 installs the newest version (npm i --location=global firebase-tools), which is 15.30.2 today.
  • The declared range accepts it (firebase-tools: ^14.0.0 || ^15.0.0, widened in #3701).
  • Installing firebase-tools 14 makes the whole flow complete.
Directions for a fix

Read the account from login.list() rather than from login(), or treat an undefined return as "no default account" instead of reading a property from it. A spec covering the version 15 shape would be worth adding, since nothing exercises this path today.

主要言語
TypeScript
スター
7.8k
フォーク
2.2k
平均マージ
3日 6時間
マージ済み PR(30日)
5

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

angular/angularfire のほかの issue

angular/angularfire の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。