Skip to content

[dev-tool] Log real tsc failure detail instead of [object Object]#39240

Open
jeremymeng wants to merge 3 commits into
mainfrom
jeremymeng-dev-tool-build-test-error-logging
Open

[dev-tool] Log real tsc failure detail instead of [object Object]#39240
jeremymeng wants to merge 3 commits into
mainfrom
jeremymeng-dev-tool-build-test-error-logging

Conversation

@jeremymeng

Copy link
Copy Markdown
Member

Summary

runTypeScript in common/tools/dev-tool/src/commands/run/build-test.ts logged the whole SpawnSyncReturns object on failure via log.error(..., res), which rendered uselessly as [object Object].

Fix

Since tsc runs with stdio: "inherit", its diagnostics are already printed to the log. So instead of dumping the object, the failure branch now logs the actual exit code or signal. It also handles the spawn-error case (res.error) — e.g. when tsc can't be spawned, status/signal are null so the previous check missed it entirely.

Verification

From common/tools/dev-tool, npx tsc -p . --noEmit passes (exit code 0).

Small standalone follow-up to the dev-tool logging improvements in #39238.

runTypeScript in build-test.ts logged the whole SpawnSyncReturns object on
failure, rendering as a useless [object Object]. Since tsc runs with
stdio: inherit its diagnostics are already in the log, so log the exit
status/signal (and handle the spawn-error case) instead of the object.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jeremymeng jeremymeng requested a review from a team as a code owner July 10, 2026 19:38
Copilot AI review requested due to automatic review settings July 10, 2026 19:38
@github-actions github-actions Bot added the dev-tool Issues related to the Azure SDK for JS dev-tool label Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves dev-tool TypeScript compiler failure diagnostics.

Changes:

  • Handles compiler spawn errors.
  • Logs exit codes or termination signals instead of [object Object].

Comment thread common/tools/dev-tool/src/commands/run/build-test.ts
Co-authored-by: jeremymeng <7583839+jeremymeng@users.noreply.github.com>
Fixes the check-format CI failure on the previous commit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-tool Issues related to the Azure SDK for JS dev-tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants