-
Notifications
You must be signed in to change notification settings - Fork 340
Description
Description
On Windows, monorepo/workspace builds intermittently fail during Rollup minification with errors such as:
Call retries were exceededspawn UNKNOWNJavaScript 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
- Use Windows 10/11
- Node.js
v16.19.0 - Yarn
v3.6.4 - Run one of the following:
yarn workspace @embeddedchat/markups buildyarn workspace @embeddedchat/react build- or
yarn buildat repo root
- 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 })