[REQUIRED] Environment info
firebase-tools: 15.22.0 (also reproduced on 13.31.2)
Platform: macOS Tahoe (fresh clean install, no migration/backup)
Node.js: v24.17.0 and v22.23.0 (both tested, same result)
[REQUIRED] Test case
Run firebase login --no-localhost and attempt to complete authentication with a valid authorization code from the browser flow.
[REQUIRED] Steps to reproduce
- Run
firebase login --no-localhost
- Decline Gemini/telemetry prompts
- Open the provided URL in browser, sign in with Google account, copy the authorization code
- Paste the code into the CLI prompt immediately (within seconds)
- Authentication fails
Expected behavior
Login should succeed and credentials should be stored.
Actual behavior
Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth
Error: Unable to authenticate using the provided code. Please try again.
With --debug flag, the underlying error is:
Token Fetch Error: FirebaseError: FetchError: Invalid response body while trying to fetch https://accounts.google.com/o/oauth2/token: Premature close
at RetryOperation._fn (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:317:88)
Troubleshooting already performed
- Reproduced on 2 separate Macs (one fresh format, one with prior working installs)
- Reproduced with 2 different Google accounts
- Reproduced with firebase-tools 15.22.0 and 13.31.2
- Reproduced with Node v24.17.0 and v22.23.0
- Reproduced with
--no-localhost and default localhost callback flow
- Reproduced across 2 different networks (home WiFi, mobile hotspot)
- IPv6 disabled — no change
- macOS firewall disabled — no change
- No VPN, proxy, MDM profile, or Little Snitch present
- DNS cache flushed — no change
- Verified Node can successfully complete other HTTPS POST requests to Google APIs (oauth2.googleapis.com) outside the CLI's exact flow — those succeed and return complete responses
- Verified Node can successfully run a local HTTP server and receive connections on 127.0.0.1 (loopback works fine)
- The failure appears specific to the exact request/response Firebase CLI's apiv2.js makes during the OAuth token exchange, not to networking, DNS, or Node's general HTTPS/HTTP capabilities
This strongly suggests a compatibility issue between firebase-tools' HTTP client (apiv2.js) and macOS Tahoe's networking stack, though I was not able to isolate the exact mechanism.
Related: I found a similar report at #10681 with the same Node version pairing (15.21.0 / Node 24.17.0) on Windows, suggesting this may not be macOS-exclusive.
[REQUIRED] Environment info
firebase-tools: 15.22.0 (also reproduced on 13.31.2)
Platform: macOS Tahoe (fresh clean install, no migration/backup)
Node.js: v24.17.0 and v22.23.0 (both tested, same result)
[REQUIRED] Test case
Run
firebase login --no-localhostand attempt to complete authentication with a valid authorization code from the browser flow.[REQUIRED] Steps to reproduce
firebase login --no-localhostExpected behavior
Login should succeed and credentials should be stored.
Actual behavior
Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth
Error: Unable to authenticate using the provided code. Please try again.
With
--debugflag, the underlying error is:Token Fetch Error: FirebaseError: FetchError: Invalid response body while trying to fetch https://accounts.google.com/o/oauth2/token: Premature close
at RetryOperation._fn (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:317:88)
Troubleshooting already performed
--no-localhostand default localhost callback flowThis strongly suggests a compatibility issue between firebase-tools' HTTP client (apiv2.js) and macOS Tahoe's networking stack, though I was not able to isolate the exact mechanism.
Related: I found a similar report at #10681 with the same Node version pairing (15.21.0 / Node 24.17.0) on Windows, suggesting this may not be macOS-exclusive.