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

Bug: Missing stdio pipes with node:child_process #23524

Open
marvinhagemeister opened this issue Apr 24, 2024 · 2 comments
Open

Bug: Missing stdio pipes with node:child_process #23524

marvinhagemeister opened this issue Apr 24, 2024 · 2 comments
Labels
bug Something isn't working node compat

Comments

@marvinhagemeister
Copy link
Contributor

Tried the current state of running playwright in Deno (see #16899) and ran into an issue regarding the pipes set up for node:child_process.spawn(). The launcher code can be found here https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/utils/processLauncher.ts#L133

They expect to receive 5 streams to be set up, but we only set up the first three. I created a minimal reproduction out of that:

Steps to reproduce

  1. Create file main.mjs with these contents
import cp from "node:child_process";
import process from "node:process";

if (import.meta.url.endsWith("main.mjs")) {
  const child = cp.spawn(process.execPath, [import.meta.url], {
    stdio: ["ignore", "pipe", "pipe", "pipe", "pipe"],
  });

  console.assert(
    child.stdio.length === 5,
    `Expected stdio length to equal 5 but got ${child.stdio.length}`
  );
}
  1. Run DENO_FUTURE=1 deno run -A main.mjs

Can also be run in Node for comparison node main.mjs

Version: Deno 1.42.4 (git 5294885 2024-04-24)

@marvinhagemeister marvinhagemeister added bug Something isn't working node compat labels Apr 24, 2024
@cowboyd
Copy link

cowboyd commented Apr 26, 2024

@marvinhagemeister The docs only very briefly mention the ability to open other file descriptors https://nodejs.org/api/child_process.html#optionsstdio Is there any explainer anywhere on how they should behave?

@marvinhagemeister
Copy link
Contributor Author

I'm not aware of any explainer. I don't know how they're supposed to work either. One would probably look at the Node source code to get an answer to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node compat
Projects
None yet
Development

No branches or pull requests

2 participants