Skip to content

Invalid execArgv for worker threads causes a subsequent TypeError #3131

@guimard

Description

@guimard

Hi,

when launching ava with node --disable-proto=throw, it first produces this error:

$ node --disable-proto=throw /usr/bin/ava

file:///usr/share/nodejs/ava/lib/api.js:312
                                for (const error_ of error.errors) {
                                                           ^

TypeError: error.errors is not iterable
    at Api.run (file:///usr/share/nodejs/ava/lib/api.js:312:32)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async loadCli (file:///usr/share/nodejs/ava/lib/cli.js:489:21)

Node.js v18.10.0

With a little hook, we can see the real error (which has no errors property):

AggregateError: 
    Error [ERR_WORKER_INVALID_EXEC_ARGV]: Initiated Worker with invalid execArgv flags: --disable-proto=throw
        at createWorker (file:///usr/share/nodejs/ava/lib/fork.js:24:12)
        at loadFork (file:///usr/share/nodejs/ava/lib/fork.js:84:39)
        at pMap.concurrency.concurrency (file:///usr/share/nodejs/ava/lib/api.js:289:20)
        at /usr/share/nodejs/p-map/index.js:57:28
    at next (/usr/share/nodejs/p-map/index.js:43:14)
    at /usr/share/nodejs/p-map/index.js:67:7
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Ava version: 5.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcurrent functionality does not work as desiredhelp wanted

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions