Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not build-storybook, may be out of memory #15548

Closed
inspire-lts opened this issue Jul 11, 2021 · 5 comments
Closed

Can not build-storybook, may be out of memory #15548

inspire-lts opened this issue Jul 11, 2021 · 5 comments

Comments

@inspire-lts
Copy link

Describe the bug
The build-storybook command stops at 92% .
image

To Reproduce
this is my repository https://github.com/inspire-lts/taskbox

System
OS: Windows 10
Browser: Chrome
Framework: React
Version: 6.3.0
node: v14.16.1

Additional context
I try to fix it:
NODE_OPTIONS=--max_old_space_size=4096
typescript: { reactDocgen: 'react-docgen' },
typescript: { reactDocgen: 'none' },
#6408
#14355

@albseb511
Copy link

I seem to have the same issue at the moment.
I tried switching node version, npm version, removing node_modules, removing lock files

@albseb511
Copy link

Sorry I seemed to have fixed the issue, there was a typescript error.
I just assumed storybook would throw an error for incorrect types, but it does not seem to.
It ran locally. but I went through logs build-storybook.log
I saw another issue also about sb not throwing errors with TS, should have checked then.

@inspire-lts
Copy link
Author

@albseb511 thank you. I tried these, but still not work

@olemarius
Copy link

olemarius commented Aug 19, 2022

Got the same issue.

> build-storybook

info @storybook/vue3 v6.5.10
info 
info => Cleaning outputDir: C:\Git\BlocPlatform\Bloc\Frontend\Bloc.Vue\storybook-static
info => Loading presets
info => Compiling manager..
The file was saved!
vite v3.0.5 building for production...
transforming (377) node_modules\.pnpm\core-js@3.22.8\node_modules\core-js\internals\is-regexp.jsinfo => Manager built (23 s)
transforming (5691) node_modules\.pnpm\graphql@16.5.0\node_modules\graphql\jsutils\identityFunc.mjsUse of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
✓ 5704 modules transformed.

<--- Last few GCs --->

[29872:000001AC9D2A69F0]   112274 ms: Mark-sweep 4042.3 (4140.4) -> 4038.9 (4139.3) MB, 1104.3 / 0.0 ms  (average mu = 0.360, current mu = 0.045) allocation failure scavenge might not succeed
[29872:000001AC9D2A69F0]   114861 ms: Mark-sweep 4046.8 (4139.3) -> 4046.0 (4167.8) MB, 2584.2 / 0.0 ms  (average mu = 0.164, current mu = 0.001) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 00007FF63A587A1F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114207
 2: 00007FF63A516096 DSA_meth_get_flags+65542
 3: 00007FF63A516F4D node::OnFatalError+301
 4: 00007FF63AE4B2CE v8::Isolate::ReportExternalAllocationLimitReached+94
 5: 00007FF63AE358AD v8::SharedArrayBuffer::Externalize+781
 6: 00007FF63ACD8C7C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
 7: 00007FF63ACD5D94 v8::internal::Heap::CollectGarbage+4244
 8: 00007FF63ACD3710 v8::internal::Heap::AllocateExternalBackingStore+2000
 9: 00007FF63ACF8296 v8::internal::Factory::NewFillerObject+214
10: 00007FF63AA2A765 v8::internal::DateCache::Weekday+1797
11: 00007FF63AED8FC1 v8::internal::SetupIsolateDelegate::SetupHeap+494417
12: 000001AC9FB1C81E 
 ELIFECYCLE  Command failed with exit code 134.

 *  The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command pnpm run build-storybook" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

image

Workaround is to disable sourcemap in main.js

 async viteFinal(config, { configType }) {
        config.resolve.dedupe = ["@storybook/client-api"];
        const { config: userConfig } = await loadConfigFromFile(resolve(__dirname, "../vite.config.ts"));
        const finalConfig = mergeConfig(config, { 
            ...userConfig,
        build: { 
            ...config.build,
            sourcemap: false
        },
        ...
    }

@shilman
Copy link
Member

shilman commented Jun 9, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants