Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#3,768 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
angular, firebase, typescript
Domain
cli

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
7.8k
Forks
2.2k
Avg merge
3d 6h
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from angular/angularfire

All issues in angular/angularfire

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.