Skip to content

Conversation

@SirLouen
Copy link
Member

Why?

Lately I've noted that the Storybook buildis failing do to a lack of memory, at least in WSL2
I thought that was something specific to my machine, but then I noticed that @t-hamano might have this problem also because he added in his testing instructions the same command in #74835

How?

Adding the memory increase in the build command

Testing Instructions

  1. Ideally run Windows/with WSL2, not sure if this is happening in other systems
  2. Run npm run storybook:build
  3. 🐞 Build will blow at some point during the transforming phase with:
[149235:0x10ef5000]   131200 ms: Mark-Compact 4032.5 (4133.1) -> 4018.7 (4135.9) MB, pooled: 0 MB, 756.37 / 0.00 ms  (average mu = 0.153, current mu = 0.073) allocation failure; scavenge might not succeed
[149235:0x10ef5000]   132027 ms: Mark-Compact 4036.0 (4136.1) -> 4021.3 (4137.6) MB, pooled: 0 MB, 768.85 / 0.00 ms  (average mu = 0.112, current mu = 0.070) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0xe40d24 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
 2: 0x1216be0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 3: 0x1216eb7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 4: 0x1444875  [node]
 5: 0x14448a3  [node]
 6: 0x145d97a  [node]
 7: 0x1460b48  [node]
 8: 0x1cc69b1  [node]
Aborted (core dumped)
npm error Lifecycle script `storybook:build` failed with error:
npm error code 134
npm error path /home/mcamargo/src/wordpress/wordpress-develop/src/wp-content/plugins/gutenberg/storybook
npm error workspace @wordpress/storybook@0.0.0
npm error location /home/mcamargo/src/wordpress/wordpress-develop/src/wp-content/plugins/gutenberg/storybook
npm error command failed
npm error command sh -c storybook build -c . -o ./build

@SirLouen SirLouen self-assigned this Jan 25, 2026
@SirLouen SirLouen added [Type] Build Tooling Issues or PRs related to build tooling Storybook Storybook and its stories for components labels Jan 25, 2026
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Yes, I can't complete storybook build process without increasing memory limit. I'm also using WSL2.

Perhaps the ideal thing would be to do an optimization of the entire Gutenberg project, but for now, I think it makes sense to increase the memory in the script by default.

@t-hamano t-hamano requested a review from a team January 26, 2026 06:00
Copy link
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix. The change looks fine to me, but I don't have a Windows machine to test the change.

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

Labels

Storybook Storybook and its stories for components [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants