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

Promisified execFile returns undefined in Deno #3145

Closed
GJZwiers opened this issue Jan 27, 2023 · 2 comments · Fixed by #3161
Closed

Promisified execFile returns undefined in Deno #3145

GJZwiers opened this issue Jan 27, 2023 · 2 comments · Fixed by #3161
Labels
bug Something isn't working

Comments

@GJZwiers
Copy link
Contributor

The following code works in Node 18.1 but not in Deno 1.30:

// exec.mjs
import * as cp from 'node:child_process';
import { promisify } from 'node:util';

const execFile = promisify(cp.execFile);

const child = await execFile('deno', ['--version']);
console.log(child.stdout);

With Deno both child.stdout and child.stderr are undefined

deno run --allow-run=deno --allow-read ./exec.mjs

undefined

With Node:

node exec.mjs
deno 1.30.0 (release, x86_64-pc-windows-msvc)
v8 10.9.194.5
typescript 4.9.4
@bartlomieju bartlomieju transferred this issue from denoland/deno Jan 28, 2023
@bartlomieju bartlomieju added bug Something isn't working node labels Jan 28, 2023
@psimk
Copy link

psimk commented Jan 29, 2023

I managed to reduce the reproduction to this:

// exec.mjs
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';

console.log(promisify.custom, promisify.custom in execFile);

Deno

deno run exec.mjs
Symbol(nodejs.util.promisify.custom) false

Node

node exec.mjs                                    
Symbol(nodejs.util.promisify.custom) true

It seems like the promisify.custom that was used to define the custom promisify function of execFile is different from the one that we import from node:util.

@PolarETech
Copy link
Contributor

Sorry I missed sending my comment. I would like to take up this issue.

@kt3k kt3k closed this as completed in #3161 Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants