Title: `ng add @angular/fire` stops with `Cannot read properties of undefined (reading 'email')` when firebase-tools 15.26+ detects an AI agent · Issue #3768 · angular/angularfire · GitHub
Open Graph Title: `ng add @angular/fire` stops with `Cannot read properties of undefined (reading 'email')` when firebase-tools 15.26+ detects an AI agent · Issue #3768 · angular/angularfire
X Title: `ng add @angular/fire` stops with `Cannot read properties of undefined (reading 'email')` when firebase-tools 15.26+ detects an AI agent · Issue #3768 · angular/angularfire
Description: ng add @angular/fire stops during setup when firebase-tools 15.26.0 or later runs non-interactively. Running ng add yourself in an ordinary terminal is not affected. Reproduction In an Angular 21 application with firebase-tools 15.28.1, ...
Open Graph Description: ng add @angular/fire stops during setup when firebase-tools 15.26.0 or later runs non-interactively. Running ng add yourself in an ordinary terminal is not affected. Reproduction In an Angular 21 a...
X Description: ng add @angular/fire stops during setup when firebase-tools 15.26.0 or later runs non-interactively. Running ng add yourself in an ordinary terminal is not affected. Reproduction In an Angular 21 a...
Opengraph URL: https://github.com/angular/angularfire/issues/3768
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ng add @angular/fire` stops with `Cannot read properties of undefined (reading 'email')` when firebase-tools 15.26+ detects an AI agent","articleBody":"`ng add @angular/fire` stops during setup when firebase-tools 15.26.0 or later runs non-interactively. Running `ng add` yourself in an ordinary terminal is not affected.\n\n### Reproduction\n\nIn an Angular 21 application with firebase-tools 15.28.1, run `ng add @angular/fire@next` from a terminal where `AI_AGENT` or `CLAUDECODE` is set, for example one driven by Claude Code, and pick any feature. Setup prints:\n\n```\nUsing firebase-tools version 15.28.1\nCannot read properties of undefined (reading 'email')\n```\n\nThe same run with those variables unset reaches the account, project and app questions.\n\n### Cause\n\nfirebase-tools 15.26.0 turns on non-interactive mode when it detects an AI agent ([firebase/firebase-tools#10856](https://github.com/firebase/firebase-tools/pull/10856)). In that mode `login()` now starts a remote sign-in and returns `undefined` instead of the signed-in account ([firebase/firebase-tools#10777](https://github.com/firebase/firebase-tools/pull/10777)). Earlier versions threw an error in that mode instead.\n- `userPrompt` in `src/schematics/setup/prompts.ts:110` reads `defaultUser.email` from that return value, which is the error above.\n- `src/schematics/setup/index.ts:94` gets `undefined` the same way. With line 110 fixed alone, setup then calls `login.use` for an account that is already in use, which fails with `Already using account ... for this project directory.`\n- `ng deploy` reads `user.email` from `login()` in `src/schematics/deploy/actions.ts:560`.\n\n### Who is affected\n\nfirebase-tools runs non-interactively when stdin is not a terminal, or when it finds one of a list of variables, such as `AI_AGENT`, `CLAUDECODE`, `CURSOR_AGENT` or `COPILOT_GITHUB_TOKEN`, in the environment.\n- An AI coding tool that runs `ng add` or `ng deploy` for you.\n- A terminal that inherited one of those variables, for example an editor started from inside an agent session, or a shell profile that exports `COPILOT_GITHUB_TOKEN` for the Copilot CLI.\n- Every published AngularFire release has the crashing code, including `latest` (20.1.0) and `next` (21.0.0-rc.1).\n- Current Cursor (3.22.7) and VS Code (1.138.0) set them only in the terminals their agents use, not in the terminals you type in.\n- firebase-tools 15.25.1 and earlier, including 14.x, return the account in a terminal.\n\n### Directions for a fix\n\n`login()` returns the signed-in account in agent mode when it is passed `interactive: true`, an option firebase-tools applies after its agent check. Where no account may be signed in yet, an `undefined` return should mean \"no account\" rather than be read from.\n\n","author":{"url":"https://github.com/armando-navarro","@type":"Person","name":"armando-navarro"},"datePublished":"2026-09-23T01:59:08Z","url":"https://github.com/angular/angularfire/issues/3768"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:93919b39-a479-cbbe-910c-e84a8d7ecad8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDEA:2BE4CA:23994AA:2F14F59:6B036735 |
| html-safe-nonce | 4960e9d7359a3f2c46277dd67bafef8a7f33acac3806c94d473ee554f0a4ef10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREVBOjJCRTRDQToyMzk5NEFBOjJGMTRGNTk6NkIwMzY3MzUiLCJ2aXNpdG9yX2lkIjoiNzI5NjU2ODU4NjMyMjI3NDEwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c00fbf3fcbb7076ae7daee9067fb693a8e6fe1adfd4546b1abb40e0db8aaeba4 |
| hovercard-subject-tag | issue:5547655257 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/3768/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e80a43de89cb44c4f0e7dc07ad7ddffc0fd8d63905c956bc75fc1b4c5585c7ec/angular/angularfire/issues/3768 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e80a43de89cb44c4f0e7dc07ad7ddffc0fd8d63905c956bc75fc1b4c5585c7ec/angular/angularfire/issues/3768 |
| og:image:alt | ng add @angular/fire stops during setup when firebase-tools 15.26.0 or later runs non-interactively. Running ng add yourself in an ordinary terminal is not affected. Reproduction In an Angular 21 a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | armando-navarro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width