Skip to content

Build hangs / floods terminal with "[ora] Multiple concurrent spinners detected" since v22 (parallel entry-point builds + ora ≥ 9.1) #3447

Description

@pvds

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

  1. Create a library with ~10–20 secondary entry points (each just ng-package.json and a src/index.ts
    exporting a component).

  2. Install ng-packagr 22.2.1, Angular 22.2.0, TypeScript 6.0.3, with ora resolving to 9.4.x (the default).

  3. Run in a real terminal:

    ng-packagr -p ng-package.json -c tsconfig.lib.prod.json
    

    → Ora warnings, runaway output, no completion.

  4. Run with piped output:

    ng-packagr -p ng-package.json -c tsconfig.lib.prod.json | cat
    

    → Completes normally.

  5. 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).

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions