Skip to content

Windows builds fail intermittently due to Rollup Terser worker crashes and OOM #1137

@Shreyas2004wagh

Description

@Shreyas2004wagh

Description

On Windows, monorepo/workspace builds intermittently fail during Rollup minification with errors such as:

  • Call retries were exceeded
  • spawn UNKNOWN
  • JavaScript heap out of memory

This instability affects package builds (notably @embeddedchat/markups, @embeddedchat/react, @embeddedchat/ui-elements, and @embeddedchat/ui-kit) and blocks reliable local builds and CI on Windows.


Steps to reproduce

  1. Use Windows 10/11
  2. Node.js v16.19.0
  3. Yarn v3.6.4
  4. Run one of the following:
    • yarn workspace @embeddedchat/markups build
    • yarn workspace @embeddedchat/react build
    • or yarn build at repo root
  5. Observe intermittent Rollup failures during minification

Expected behavior

Workspace and monorepo builds should complete consistently on Windows without worker crashes or memory-related failures.


Actual behavior

Builds intermittently fail during Rollup minification with worker process crashes and OOM errors, even when no code changes are made.


Root cause

rollup-plugin-terser defaults to spawning multiple worker processes.
For large bundles in this monorepo, this creates excessive process and memory pressure on Windows, leading to instability.

Additionally, direct source imports (e.g. @embeddedchat/markups/src) cause Storybook parsing failures in some environments.


Proposed fix

  • Throttle Terser workers in Rollup configs:
    terser({ numWorkers: 1 })

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions