Skip to content

Commit b1e5f51

Browse files
committed
fix(@angular/build): Address build issue in Node.js LTS versions with 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)
1 parent 302c4d1 commit b1e5f51

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/angular/build/src/tools/esbuild/javascript-transformer.ts

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export class JavaScriptTransformer {
6262
// Shutdown idle threads after 1 second of inactivity
6363
idleTimeout: 1000,
6464
recordTiming: false,
65+
// Prevent passing `--import` (loader-hooks) from parent to child worker.
66+
execArgv: [],
6567
});
6668

6769
return this.#workerPool;

0 commit comments

Comments
 (0)