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); + });