Skip to content

Commit

Permalink
fix(node): Ensure NODE_OPTIONS is not passed to worker threads (#14824
Browse files Browse the repository at this point in the history
)

- Closes #14524

Just like `execArgv` can cause `--import` and `--require` to be
preloaded in worker threads and cause infinite loops, `NODE_OPTIONS` can
cause this too.
  • Loading branch information
timfish authored Dec 23, 2024
1 parent e682512 commit 9b1ab0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/node/src/integrations/anr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ async function _startWorker(
workerData: options,
// We don't want any Node args to be passed to the worker
execArgv: [],
env: { ...process.env, NODE_OPTIONS: undefined },
});

process.on('exit', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const localVariablesAsyncIntegration = defineIntegration(((
workerData: options,
// We don't want any Node args to be passed to the worker
execArgv: [],
env: { ...process.env, NODE_OPTIONS: undefined },
});

process.on('exit', () => {
Expand Down

0 comments on commit 9b1ab0e

Please sign in to comment.