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
  • Loading branch information
alan-agius4 committed Oct 23, 2024
1 parent efb4341 commit cc345b0
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export class JavaScriptTransformer {
this.#workerPool ??= new WorkerPool({
filename: require.resolve('./javascript-transformer-worker'),
maxThreads: this.maxThreads,
// Prevent passing `--import` (loader-hooks) from parent to child worker.
execArgv: [],
});

return this.#workerPool;
Expand Down

0 comments on commit cc345b0

Please sign in to comment.