Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execSync exception type doesn't match ExecException #57392

Open
ianzone opened this issue Mar 9, 2025 · 0 comments
Open

execSync exception type doesn't match ExecException #57392

ianzone opened this issue Mar 9, 2025 · 0 comments

Comments

@ianzone
Copy link

ianzone commented Mar 9, 2025

Version

v22.14.0

Platform

Linux think 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

node --experimental-transform-types index.ts

try {
  execSync('node -e \'console.log("new log");console.error("new err");process.exit(1)\'')
} catch (error) {
  const err = error as ExecException;
  console.log(err.stdout);
}

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

print "new log" is expected cuz ExecException.stdout is a string type.

What do you see instead?

printed <Buffer 6e 65 77 20 6c 6f 67 0a>

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant