GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(schematics): read the signed-in Firebase account on firebase-tools 15.26+ by armando-navarro · Pull Request #3769 · angular/angularfire

Conversation

@armando-navarro

@armando-navarro armando-navarro commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Fixes #3768

firebase-tools 15.26 switches to non-interactive mode when it detects an AI agent, and in that mode login() returns undefined instead of the signed-in account. ng add and ng deploy read .email from that result and crash.

Changes

  • A new getActiveAccount helper in src/schematics/firebaseTools.ts passes interactive: true to login(). With an account signed in, login() returns it before any prompt, on firebase-tools 14 and 15.
  • Setup reads the active account through that helper in both places it needs it.
    • It no longer passes its own options to login(). Those options carry the Angular project name, which firebase-tools checks as a Firebase project ID, so a project named myApp stopped setup with Invalid project id: myApp. on any firebase-tools version.
  • The firebase login and firebase login:add commands setup starts get --interactive, so under an agent they sign the person in instead of printing remote sign-in steps.
  • When firebase login leaves no account signed in, setup says to run firebase login instead of crashing.
  • ng deploy signs in only when no account is listed, stops with the same kind of message if none is afterward, and reads the account through the helper.
  • login() is typed as possibly undefined, so the compiler flags an unguarded .email read.
  • The Quickstart and the firebase-tools install page stop saying to install firebase-tools 14. They say to run ng add yourself rather than through an AI agent, and to run it again if it already stopped.

Verification

  • ng add setup against a real Firebase project reached the account, project and app questions with:
    • firebase-tools 15.28.1 with AI_AGENT and CLAUDECODE set, which crashed before this change
    • firebase-tools 15.28.1 without them
    • firebase-tools 14.27.0
  • With --project=myApp, setup now gets past the account question, where it previously stopped with Invalid project id: myApp.
  • With what ng add @angular/fire@next installs today (21.0.0-rc.1-canary.95b3de1, built from the same commit as 21.0.0-rc.1), after a run that crashed under an agent, running ng add again without the agent variables completed setup. The crashed run left only an empty firebase.json.
  • Three new ng deploy specs cover the interactive flag, an undefined result for a signed-in account, and the no-account message. npm run test:node after a full build: 334 specs, 0 failures.
  • userPrompt has no spec, because the spec runner loads files as ES modules and prompts.ts calls require() when it loads.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@armando-navarro
fix(schematics): read the signed-in account on firebase-tools 15.26+
698e5fd
firebase-tools 15.26 runs non-interactively when it detects an AI
agent or when stdin is not a terminal, and in that mode login()
returns undefined instead of the signed-in account. `ng add` and
`ng deploy` crashed reading `.email` from it.

getActiveAccount passes `interactive: true`, which returns the account
without a prompt once one is signed in. The `firebase login` and
`firebase login:add` commands setup starts get `--interactive` for the
same reason. Setup no longer passes its options to login(), since they
carry the Angular project name, which firebase-tools rejects as a
project id for names like `myApp`.

The Quickstart stops telling readers to install firebase-tools 14.

Fixes angular#3768
@armando-navarro
armando-navarro requested a review from tyler-reitz September 25, 2026 02:57
@armando-navarro armando-navarro added bump: patch Size of the change: a fix or docs change that reaches users comp: docs Documentation. comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen. labels Sep 25, 2026
tyler-reitz
tyler-reitz approved these changes Sep 25, 2026
View reviewed changes

@tyler-reitz tyler-reitz left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving.

Confirmed the root cause in firebase-tools 15.28.1 itself: detectAIAgent() sets nonInteractive, and that branch returns before the already-signed-in path, so interactive: true is the right lever. Also checked that -i, --interactive is present in firebase-tools 14.0.0, so the new firebase login --interactive spawn is safe at the minimum supported version. Neutered each of the three behaviors the new specs cover and confirmed all three go red.

One nit, not blocking: docs/install-and-setup.md says the stopped run "leaves nothing to clean up", but setup writes firebase.json before the login step, so the empty one your description mentions is left behind.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tyler-reitz tyler-reitz mentioned this pull request Sep 25, 2026
fix(auth): stop beforeAuthStateChanged from holding the app unstable #3770
Merged
@armando-navarro
docs: say what a stopped ng add leaves behind
8e1cb9b
@armando-navarro

armando-navarro commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks, you're right. The latest commit rewords it to say the stopped run leaves only an empty firebase.json, which the second run reuses.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@armando-navarro
Merge branch 'main' into a58-login-undefined
edd4729
@armando-navarro
armando-navarro merged commit 38dfc3f into angular:main Sep 27, 2026
24 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@armando-navarro armando-navarro added this to the 21.0.0 milestone Sep 28, 2026
@armando-navarro armando-navarro added target: patch bump: patch Size of the change: a fix or docs change that reaches users and removed bump: patch Size of the change: a fix or docs change that reaches users labels Oct 1, 2026
@armando-navarro armando-navarro modified the milestones: 21.0.0, 21.0.0-rc.2 Oct 1, 2026
@armando-navarro armando-navarro mentioned this pull request Oct 9, 2026
Backport ten fixes to 20.1.x for 20.1.1 #3798
Merged
@armando-navarro armando-navarro added the backport: 20.1.x Cherry-pick onto the 20.1.x branch for a 20.1 patch release label Oct 9, 2026
armando-navarro added a commit that referenced this pull request Oct 10, 2026
@armando-navarro
fix(schematics): read the signed-in account on firebase-tools 15.26+ (#…
490b68c
…3769)

firebase-tools 15.26 runs non-interactively when it detects an AI
agent or when stdin is not a terminal, and in that mode login()
returns undefined instead of the signed-in account. `ng add` and
`ng deploy` crashed reading `.email` from it.

getActiveAccount passes `interactive: true`, which returns the account
without a prompt once one is signed in. The `firebase login` and
`firebase login:add` commands setup starts get `--interactive` for the
same reason. Setup no longer passes its options to login(), since they
carry the Angular project name, which firebase-tools rejects as a
project id for names like `myApp`.

The Quickstart stops telling readers to install firebase-tools 14, and
says what a stopped run leaves behind.

Fixes #3768

The Quickstart changes are left out, since docs are not backported.
(cherry picked from commit 38dfc3f)
This was referenced Oct 23, 2026
The docs on 21.0.x still describe AngularFire 21 as a release candidate #3812
Closed
docs: describe AngularFire 21 as released, not as a release candidate #3813
Merged
docs: describe AngularFire 21 as released, not as a release candidate (main) #3814
Merged
armando-navarro added a commit that referenced this pull request Oct 26, 2026
@armando-navarro
docs: describe AngularFire 21 as released, not as a release candidate (…
2f5ef49
…#3813)

The docs on 21.0.x still install with @angular/fire@next, call 21 a
release candidate, and carry the AI-agent note for the firebase-tools
15.26 crash that #3769 fixed on this branch. The 21.0.0 tag is cut from
this branch, so its docs should describe the release.

The upgrade command keeps @angular/fire unversioned: only the first
@angular/ package in an ng update command picks the CLI that runs it.
The Node.js note gives the versioned form for updating AngularFire alone.
armando-navarro added a commit that referenced this pull request Oct 26, 2026
@armando-navarro
docs: describe AngularFire 21 as released, not as a release candidate (…
7146c2d
…#3814)

Same change as #3813 on 21.0.x, carried to main because the public
announcements and the rc.1 release notes link the upgrade guide at
blob/main, so main's copy must read the same once 21.0.0 is on latest.
The AI-agent note goes too: its fix (#3769) has been on main since rc.2.

The upgrade command keeps @angular/fire unversioned: only the first
@angular/ package in an ng update command picks the CLI that runs it.

(cherry picked from commit ca70d4c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tyler-reitz tyler-reitz tyler-reitz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

backport: 20.1.x Cherry-pick onto the 20.1.x branch for a 20.1 patch release bump: patch Size of the change: a fix or docs change that reaches users comp: docs Documentation. comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen.

Projects

None yet

Milestone

21.0.0-rc.2

Development

Successfully merging this pull request may close these issues.

ng add @angular/fire stops with Cannot read properties of undefined (reading 'email') when firebase-tools 15.26+ detects an AI agent

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@armando-navarro @tyler-reitz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.