moonrepo / moon

A build system and monorepo management tool for the web ecosystem, written in Rust.
https://moonrepo.dev/moon
MIT License
2.89k stars 157 forks source link

[bug] Edge Case: Node Workers, `--title` #891

Closed shellscape closed 1 year ago

shellscape commented 1 year ago

Describe the bug

Super edge case I just ran into using the ava package and command: ava in a task:

[DEBUG 13:38:55] moon_process::command_inspector  Running command node --title svc-test:test ../../node_modules/ava/entrypoints/cli.mjs  env_vars={"MOON_PROJECT_SOURCE": "services/svc-test", "MOON_CACHE_DIR": "/Users/user/code/test/.moon/cache", "MOON_TARGET": "svc-test:test", "MOON_PROJECT_RUNFILE": "/Users/user/code/test/.moon/cache/states/svc-test/runfile.json", "MOON_PROJECT_ID": "svc-test", "MOON_WORKSPACE_ROOT": "/Users/user/code/test", "MOON_PROJECT_ROOT": "/Users/user/code/test/services/svc-test", "MOON_TOOLCHAIN_DIR": "/Users/user/.proto", "MOON_WORKING_DIR": "/Users/user/code/test/services/svc-test"} working_dir=/Users/user/code/test/services/svc-test
  ⚠ Using configuration from /Users/user/code/test/ava.config.js
{ input: [] }

✘ 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


This is related to the use of workers in Ava (and Vitest among others). 

**Steps to reproduce**

We can put together a reproduction if needed.

**Expected behavior**

Not sure, but it would be cool if there was a way to disable the use of the `--title` flag for constructed node calls.

**Screenshots**

n/a

**Environment**

<!-- Run `npx envinfo` and paste it below. This requires Node.js to be installed. -->

Moon 1.7.1 MacOS Ventura



**Additional context**

<!-- Add any other context about the problem here. -->
milesj commented 1 year ago

This is weird, is ava trying to read the args from the parent node process??

shellscape commented 1 year ago

Crap I thought I had pasted the related issues:

https://github.com/avajs/ava/issues/3207 https://github.com/nodejs/node/issues/41103#issuecomment-1054384840

it looks like possibly a bug with Node, and something that Ava should account for. likelihood that either gets resolved in a timely manner is slim.

milesj commented 1 year ago

Yikes. I can probably remove the title for now. I'm not sure anyone actually cares about it... lol.

milesj commented 1 year ago

1.7.2

shellscape commented 1 year ago

much appreciated