CLI crashes with libuv assertion after printing its result on Windows - exit code then reads as failure

Open
#11,099 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js, typescript

Research direction

Reproduce the issue with firebase login and firebase apps:sdkconfig <app-id> on Windows 11 using Node v24.18.0, then compare commands that exit cleanly such as projects:list. Trace the Windows process-shutdown path around the reported src\win\async.c libuv assertion; done means the result still prints, no assertion occurs, and the process exits with code 0.

Written by the indexing model from the issue text.

Description

firepit
[CLI crashes with libuv assertion after printing its result - exit code then reads as failure]

CLI Version: firebase-tools 15.30.0
Platform: Windows 11 Pro (10.0.26200), Node v24.18.0
Node Version: v24.18.0

Steps to reproduce:
  1. firebase login
  2. Run a subcommand that prints a result and exits, e.g. firebase apps:sdkconfig <app-id>
Expected behavior

Process exits 0 after printing the result.

Actual behavior

Process prints its full result to stdout, then crashes:

Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 94

Exit code is then 127, even though the command's own output shows it completed
successfully. Measured in one session, same binary, same login:

subcommand assertion fires exit code
login yes n/a (interactive)
apps:sdkconfig yes 127
projects:list no 0
groups:create no 0
testers:add no 0
testers:list no 0

Non-deterministic across otherwise-similar subcommands in the same process/session, which
suggests a race in libuv handle teardown on process exit (Windows-specific: src\win\async.c)
rather than anything about the individual command.

Impact

Any caller that gates on $LASTEXITCODE (or any exit-code check) cannot tell a real failure
from this teardown crash - a command that fully completed and printed its result can still be
read as failed, which for an upload/publish command silently corrupts release tooling built on
top of the CLI.

Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 17h
Merged PRs (30d)
73

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 firebase/firebase-tools

All issues in firebase/firebase-tools

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.