Skip to content

Commit

Permalink
fix(@angular/build): Address build issue in Node.js LTS versions with…
Browse files Browse the repository at this point in the history
… prerendering or SSR

In Node.js 20, changes to ESM loader hooks result in the `--import` execArgv being passed from the parent to child workers.

This commit resolves the issue by setting an empty `execArgv` in the JavaScript transformer, preventing unintended propagation.

Closes #28683

(cherry picked from commit cc345b0)
  • Loading branch information
alan-agius4 committed Oct 23, 2024
1 parent 302c4d1 commit b1e5f51
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export class JavaScriptTransformer {
// Shutdown idle threads after 1 second of inactivity
idleTimeout: 1000,
recordTiming: false,
// Prevent passing `--import` (loader-hooks) from parent to child worker.
execArgv: [],
});

return this.#workerPool;
Expand Down

0 comments on commit b1e5f51

Please sign in to comment.