Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,768 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
angular, firebase, typescript
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
7.8k
Fork
2.2k
Merge medio
3g 6h
PR unite (30g)
5

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di angular/angularfire

Tutte le issue di angular/angularfire

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.