RocketChat / RocketChat/EmbeddedChat

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

Open
#1,137 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
165
Forks
381
Avg merge
1d 2h
Merged PRs (30d)
1

Description

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 })

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the affected workspace builds on Windows with Node.js v16.19.0 and Yarn v3.6.4, then inspect the Rollup configurations used by @embeddedchat/markups, @embeddedchat/react, @embeddedchat/ui-elements, and @embeddedchat/ui-kit. Verify whether minification worker limits address the crashes and check the direct @embeddedchat/markups/src import case in Storybook. Done means the listed builds complete consistently without worker or OOM failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, react, rollup
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.