From 64764a78ab1ddca70a0bcfa7c5ff0590b7513145 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 9 Apr 2026 22:16:42 +0300 Subject: [PATCH] fix(build-docs): process hanging --- apps/build-docs/src/main.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/build-docs/src/main.ts b/apps/build-docs/src/main.ts index cca17125d8..4ed69962b8 100644 --- a/apps/build-docs/src/main.ts +++ b/apps/build-docs/src/main.ts @@ -28,4 +28,13 @@ async function main() { cpSync(join(context.baseDir, "user-guide/404.html"), join(context.baseDir, "404.html")); } -main(); +// Note: forcing process.exit() because importing notes via the core triggers +// fire-and-forget async work in `notes.ts#downloadImages` (a 5s setTimeout that +// re-schedules itself via `asyncPostProcessContent`), which keeps the libuv +// event loop alive forever even after main() completes. +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error("Error building documentation:", error); + process.exit(1); + });