Since ng-packagr 22, building a library with multiple secondary entry points hangs when stdout is a TTY.
It repeatedly prints:
[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.
Output grows without bound (hundreds of MB within 1–2 minutes). The build never finishes, or the host process
crashes (seen with Nx, see nrwl/nx#37183).
With stdout piped (non-TTY) the build completes normally.
Cause
- v22 builds independent entry points in parallel in one process (
scheduleEntryPoints in
src/lib/ng-package/package.transform.js, maxConcurrency = min(availableParallelism() - 1, 8)).
- Each entry point creates its own
ora spinner in compile-ngc.transform, write-bundles.transform and
write-package.transform.
- ora ≥ 9.1.0 hooks
process.stdout.write / process.stderr.write while a spinner is active. ora supports one
spinner at a time. With several active spinners, the hooks wrap each other and are restored out of order, so
every write gets more ESC[1G prefixes.
- ng-packagr 21 (sequential builds) is not affected, and neither is v22 with ora 9.0.0 (no stream hooks).
How To Reproduce
-
Create a library with ~10–20 secondary entry points (each just ng-package.json and a src/index.ts
exporting a component).
-
Install ng-packagr 22.2.1, Angular 22.2.0, TypeScript 6.0.3, with ora resolving to 9.4.x (the default).
-
Run in a real terminal:
ng-packagr -p ng-package.json -c tsconfig.lib.prod.json
→ Ora warnings, runaway output, no completion.
-
Run with piped output:
ng-packagr -p ng-package.json -c tsconfig.lib.prod.json | cat
→ Completes normally.
-
Force ora@9.0.0 via overrides/resolutions and repeat step 3.
→ Completes normally.
Expected Behaviour
Parallel entry-point builds should not break TTY output. Possible fixes:
- use a single shared spinner or progress reporter for the whole build instead of one
ora instance per entry
point; or
- disable spinners when
maxConcurrency > 1; or
- pin
ora to ~9.0.0 as a stopgap.
Environment
ng-packagr: 22.2.1
@angular/compiler-cli: 22.2.0
typescript: 6.0.3
ora: 9.4.1 (hangs), 9.0.0 (works)
node: 24.20.0
OS: macOS (darwin-arm64)
Workaround
# pnpm-workspace.yaml
overrides:
ng-packagr@^22>ora: 9.0.0
Or pipe output / use a non-TTY output mode (e.g. Nx --outputStyle=stream).
Since ng-packagr 22, building a library with multiple secondary entry points hangs when stdout is a TTY.
It repeatedly prints:
Output grows without bound (hundreds of MB within 1–2 minutes). The build never finishes, or the host process
crashes (seen with Nx, see nrwl/nx#37183).
With stdout piped (non-TTY) the build completes normally.
Cause
scheduleEntryPointsinsrc/lib/ng-package/package.transform.js,maxConcurrency = min(availableParallelism() - 1, 8)).oraspinner incompile-ngc.transform,write-bundles.transformandwrite-package.transform.process.stdout.write/process.stderr.writewhile a spinner is active. ora supports onespinner at a time. With several active spinners, the hooks wrap each other and are restored out of order, so
every write gets more
ESC[1Gprefixes.How To Reproduce
Create a library with ~10–20 secondary entry points (each just
ng-package.jsonand asrc/index.tsexporting a component).
Install ng-packagr 22.2.1, Angular 22.2.0, TypeScript 6.0.3, with ora resolving to 9.4.x (the default).
Run in a real terminal:
→ Ora warnings, runaway output, no completion.
Run with piped output:
→ Completes normally.
Force
ora@9.0.0via overrides/resolutions and repeat step 3.→ Completes normally.
Expected Behaviour
Parallel entry-point builds should not break TTY output. Possible fixes:
orainstance per entrypoint; or
maxConcurrency > 1; ororato~9.0.0as a stopgap.Environment
Workaround
Or pipe output / use a non-TTY output mode (e.g. Nx
--outputStyle=stream).