You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add option to filter invalid arguments from execArgv when launching worker threads #3207
✘ Internal error
Error [ERR_WORKER_INVALID_EXEC_ARGV]: Initiated Worker with invalid execArgv flags: --title
Error [ERR_WORKER_INVALID_EXEC_ARGV]: Initiated Worker with invalid execArgv flags: --title
at new NodeError (node:internal/errors:399:5)
at new Worker (node:internal/worker:192:13)
at createWorker (file:///Users/user/code/test/node_modules/.pnpm/ava@5.3.0/node_modules/ava/lib/fork.js:24:12)
at loadFork (file:///Users/user/code/test/node_modules/.pnpm/ava@5.3.0/node_modules/ava/lib/fork.js:84:39)
at pMap.concurrency.concurrency (file:///Users/user/code/test/node_modules/.pnpm/ava@5.3.0/node_modules/ava/lib/api.js:289:20)
at file:///Users/user/code/test/node_modules/.pnpm/p-map@5.5.0/node_modules/p-map/index.js:141:26
Yeah it's a tricky one. This is a documented issue across the Node ecosystem as well - it's a gap between process and workers in Node and so far the Node core team won't address it. The tool I was using has since removed use of --title from their code, so my immediate cause is fixed. And that's probably the process for most users - asking their tooling authors (or their own team) to remove that parameter until Node itself acts on some compatibility. Filtering will probably work in the near term, so probably not so problematic until it breaks (if it ever does) again.
If that doesn't feel right, adding to the docs about this edge case would probably suffice.
Having thought about this some more, we could add a filterExecArgv() through the ava.config.* files. It could receive the individual values allowing end-users to discard incompatible ones.
changed the title [-]`execArgv` should not be passed invalid arguments[/-][+]Add option to filter invalid arguments from `execArgv` when launching worker threads[/+]on Jul 30, 2023
Activity
novemberborn commentedon Jun 16, 2023
@shellscape I'm not sure what the best way out of this is.
We do explicitly forward the
execArgv, maybe that is not necessary? You can use thenodeArgumentsoption to specify additional arguments.I think not forwarding
execArgvwould be a breaking change so now's the time.novemberborn commentedon Jun 16, 2023
Looks like the explicit
process.execArgvreference was added for a debugging feature back in 2016: #874The problem though is we need to pass a flag to enable source maps, which means we can never inherit the default
execArgv:ava/lib/fork.js
Line 17 in 6398772
Filtering the list seems problematic since it may change between Node.js releases, unless there's a third party dependency we can use for that.
shellscape commentedon Jun 19, 2023
Yeah it's a tricky one. This is a documented issue across the Node ecosystem as well - it's a gap between process and workers in Node and so far the Node core team won't address it. The tool I was using has since removed use of
--titlefrom their code, so my immediate cause is fixed. And that's probably the process for most users - asking their tooling authors (or their own team) to remove that parameter until Node itself acts on some compatibility. Filtering will probably work in the near term, so probably not so problematic until it breaks (if it ever does) again.If that doesn't feel right, adding to the docs about this edge case would probably suffice.
novemberborn commentedon Jun 19, 2023
Having thought about this some more, we could add a
filterExecArgv()through theava.config.*files. It could receive the individual values allowing end-users to discard incompatible ones.As for documentation, how about this? #3215
novemberborn commentedon Jul 3, 2023
See also #3025.
shellscape commentedon Jul 3, 2023
Those are both great. I think we're in good shape to close this.
[-]`execArgv` should not be passed invalid arguments[/-][+]Add option to filter invalid arguments from `execArgv` when launching worker threads[/+]novemberborn commentedon Jul 30, 2023
I think a filter function could be a useful addition, so I'll leave this open for now.
kirklimbu commentedon Jul 23, 2024