Closed unc0ded closed 2 years ago
Resolved and released the fix in v9.1.0 of Bree. Minor version bump reason is due to anyone using workerData env (which they shouldn't be); as they would typically be accessing the env from process.env
. Thanks for filing this issue @unc0ded.
Describe the bug
Actual behavior
Setting a job-specific
worker.env
field toSHARE_ENV
causes nodejs to crash with a DOMException[DataCloneError]: Symbol(nodejs.worker_threads.SHARE_ENV) could not be cloned.
Expected behavior
No exception should be encountered, as the
worker.env
field should not be cloned into the worker thread, unlikeworker.workerData
. The problematic piece of code can be found here at line 310, where the job object is directly added toworkerData
, which means that the symbolSHARE_ENV
will be tried to be cloned into the worker thread, causing an exception.Code to reproduce
Checklist