You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix unhandled rejection from process.stdin.close() in execProcess
execProcess() in src/core/process.ts called process.stdin.close()
without awaiting the returned Promise. When the child closes/errors
its stdin before the parent's close completes, the close Promise
rejects with "Writable stream is closed or errored." Because the
Promise was unhandled, the rejection escaped the surrounding
try/catch and surfaced on a later microtask as an uncaught Deno
rejection that aborted the render — bypassing the try/catch in
analyzeNeededPackages that was meant to fall back gracefully.
Manifests on Linux at roughly a 1% race rate when typst-gather
analyze runs against a broken or fast-failing input. Confirmed on
Ubuntu CI; not reproduced on macOS arm64.
The fix is to await the close() inside a try/catch — the child's
exit status reflects any real failure, so the close rejection is
not actionable from execProcess.
Also surface the captured stderr in the fallback warning from
analyzeNeededPackages, so the next user with a broken typst-gather
binary can diagnose without objdump.
Includes a regression test that runs four execProcess scenarios
1000 iterations each with a global unhandledrejection listener and
asserts no rejection fires.
Fixes#14445
Copy file name to clipboardExpand all lines: news/changelog-1.10.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,4 +59,5 @@ All changes included in 1.10:
59
59
- ([#6651](https://github.com/quarto-dev/quarto-cli/issues/6651)): Fix dart-sass compilation failing in enterprise environments where `.bat` files are blocked by group policy.
60
60
- ([#14255](https://github.com/quarto-dev/quarto-cli/issues/14255)): Fix shortcodes inside inline and display math expressions not being resolved.
61
61
- ([#14342](https://github.com/quarto-dev/quarto-cli/issues/14342)): Work around TOCTOU race in Deno's `expandGlobSync` that can cause unexpected exceptions to be raised while traversing directories during project initialization.
62
+
- ([#14445](https://github.com/quarto-dev/quarto-cli/issues/14445)): Fix intermittent `Uncaught (in promise) TypeError: Writable stream is closed or errored.` aborting renders on Linux. `execProcess` now awaits and swallows the rejection from `process.stdin.close()` when the child closes its stdin first. The captured stderr is now also surfaced when `typst-gather analyze` falls back to staging all packages, so failures are diagnosable without bypassing `quarto`.
62
63
- ([#14359](https://github.com/quarto-dev/quarto-cli/issues/14359)): Fix intermediate `.quarto_ipynb` file not being deleted after rendering a `.qmd` with Jupyter engine, causing numbered variants (`_1`, `_2`, ...) to accumulate on disk across renders.
0 commit comments