Skip to content

Commit cc345b0

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
1 parent efb4341 commit cc345b0

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
@@ -58,6 +58,8 @@ export class JavaScriptTransformer {
5858
this.#workerPool ??= new WorkerPool({
5959
filename: require.resolve('./javascript-transformer-worker'),
6060
maxThreads: this.maxThreads,
61+
// Prevent passing `--import` (loader-hooks) from parent to child worker.
62+
execArgv: [],
6163
});
6264

6365
return this.#workerPool;

0 commit comments

Comments
 (0)