-
-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Uncaught error stack trace is misformatted on some platforms #29387
Copy link
Copy link
Closed as not planned
Labels
errorsIssues and PRs related to JavaScript errors originating in Node.js core.Issues and PRs related to JavaScript errors originating in Node.js core.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.ttyIssues and PRs related to the tty subsystem.Issues and PRs related to the tty subsystem.
Description
Activity
Metadata
Metadata
Assignees
Labels
errorsIssues and PRs related to JavaScript errors originating in Node.js core.Issues and PRs related to JavaScript errors originating in Node.js core.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.ttyIssues and PRs related to the tty subsystem.Issues and PRs related to the tty subsystem.
Some consoles do not convert ANSI escape sequences to colors, rather display them directly to the stdout. On those consoles, libuv emulates colors by intercepting stdout stream and calling corresponding Windows API functions for setting console colors, if needed.
PR #27052 introduced stack trace highlighting, but it bypasses libuv and prints the raw string. It works on Linux and on some Windows console emulators that support ANSI colors, but does not work on most Windows consoles, including the default console (cmd.exe) on Windows 8.1
As pointed out in #28308 (comment), a possible fix is to modify
PrintErrorString()to useuv_write. However, I tried different approaches, but can't get all tests to pass. I'm opening this thread so that we at least have a tracking issue for this old bug.