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
I'm running parcel as a bundler under moonrepo, and one thing it does is set the process's title via the node arg --title [task name]. This should be fine for a regular node process, but parcel dies by default since it will try and use worker threads, and pass the node process args (in process.execArgv) to the worker thread's execArgv. However node worker threads will crash if given an unexpected execArgv, so the whole process crashes with an error like
Error [ERR_WORKER_INVALID_EXEC_ARGV]: Initiated Worker with invalid execArgv flags: --title
I'm currently working around this issue by setting PARCEL_WORKER_BACKEND=process, but it took me quite a while to figure this out.
I'd say there are 3 options I can think of to improve this:
filter out any options known to throw (process level args, v8 tuning args)
just pass an empty list explicitly (so there's no execArgv in the child)
Catch the error on creating the worker and have a better error message (including mentioning PARCEL_WORKER_BACKEND)
I lean towards 2, just because it's simpler, will not break even with new options, and I don't think there's many execargv options that work with workers anyways, but I leave it to the project to decide.
There is an issue in the node repo to change this behavior (which would be ideal), but it's been open for like a year: nodejs/node#41103
If one of these approaches sounds good, I can make a PR, they all seem pretty straightforward.
The text was updated successfully, but these errors were encountered:
I'm running parcel as a bundler under moonrepo, and one thing it does is set the process's title via the node arg
--title [task name]
. This should be fine for a regular node process, but parcel dies by default since it will try and use worker threads, and pass the node process args (inprocess.execArgv
) to the worker thread'sexecArgv
. However node worker threads will crash if given an unexpectedexecArgv
, so the whole process crashes with an error likeI'm currently working around this issue by setting
PARCEL_WORKER_BACKEND=process
, but it took me quite a while to figure this out.I'd say there are 3 options I can think of to improve this:
PARCEL_WORKER_BACKEND
)I lean towards 2, just because it's simpler, will not break even with new options, and I don't think there's many execargv options that work with workers anyways, but I leave it to the project to decide.
There is an issue in the node repo to change this behavior (which would be ideal), but it's been open for like a year: nodejs/node#41103
If one of these approaches sounds good, I can make a PR, they all seem pretty straightforward.
The text was updated successfully, but these errors were encountered: