Skip to content

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

Description

@ostarev

Version

v24 LTS/default

Platform


Subsystem

No response

What steps will reproduce the bug?

Node.js process crash on build exit: Assertion failed: !(handle->flags & UV_HANDLE_CLOSING) on Windows

Environment Info

  • OS: Windows 11 (build local time check: 2026-07-06)
  • Node.js Version: v24.13.0
  • npm Version: 11.x (or matching Node v24 default)
  • Framework/Tooling: Astro ^7.0.6 with Svelte ^5.56.4 integration
  • Libraries in play: curtainsjs ^8.1.6, gsap ^3.15.0, lenis ^1.3.25

Description

When running npm run build (which runs astro check && astro build), the static assets compile successfully with 0 errors and 0 warnings. However, immediately after the compilation output shows [build] Complete!, the process crashes during termination with a low-level libuv assertion error.

Error Console Output

generating static routes 
14:11:19   ├─ /index.html (+38ms) 
14:11:19 ✓ Completed in 131ms.

14:11:19 [build] ✓ Completed in 452ms.
14:11:19 [build] 1 page(s) built in 531ms
14:11:19 [build] Complete!
Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76

How to Recreate This Issue

This issue can be reproduced on any Windows system with Node.js v24.x using a fresh Astro template:

  1. Initialize a fresh Astro project:

    npm create astro@latest test-crash -- --template basics
    cd test-crash
    npm install
  2. Run the build script:

    npm run build
  3. Verify the crash:
    Once the build completes and attempts to exit the process, the console will print:
    Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76 and exit with code 1.


Additional Context

  • The issue appears to be a use-after-close race condition when Node.js tear-down steps close file-watchers or active handles created by Vite/Astro.
  • Since the build completes successfully, all output artifacts are generated correctly. The crash only occurs on process exit.
  • This is a known OS-specific issue for Windows runtimes inside libuv.

How often does it reproduce? Is there a required condition?

Every build

What is the expected behavior? Why is that the expected behavior?

No errors.

What do you see instead?

Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76 and exit with code 1.

Additional information

What steps will reproduce the bug? section include the output of an agent, every reference/explanation is there.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions