Skip to content

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

@mmastrac

Description

@mmastrac

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions