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

node:child_process::execFile does not support timeout: undefined #22261

Closed
mmastrac opened this issue Feb 4, 2024 · 0 comments · Fixed by #22262
Closed

node:child_process::execFile does not support timeout: undefined #22261

mmastrac opened this issue Feb 4, 2024 · 0 comments · Fixed by #22262

Comments

@mmastrac
Copy link
Contributor

mmastrac commented Feb 4, 2024

This bug causes the pkl-eval package to fail when no timeout is specified.

> import {evaluate} from "npm:@pkl-community/pkl-eval"
undefined
> evaluate(`
foo = 1
`, {format: "json"}).then(console.log)

Promise {
  <rejected> RangeError [ERR_OUT_OF_RANGE]: The value of "timeout" is out of range. It must be an unsigned integer. Received undefined

We have a validateTimeout call used for spawnSync, but a different, buggier path is used for execFile.

Works in node.js:

var cp = require('child_process');
var ls = cp.execFile('ls', ['-l', '/usr'], { timeout: undefined, encoding : 'utf8' });

Fails in deno:

import cp from "node:child_process";
var ls = cp.execFile('ls', ['-l', '/usr'], { timeout: undefined, encoding : 'utf8' });
Uncaught RangeError [ERR_OUT_OF_RANGE]: The value of "timeout" is out of range. It must be an unsigned integer. Received undefined
    at Object.execFile (node:child_process:222:11)
    at <anonymous>:1:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant