-
Notifications
You must be signed in to change notification settings - Fork 106
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
[Bug] JavaScript heap out of memory (Vite build works, Storybook w/WebPack 4 works) #409
Comments
Another workaround, besides setting your memory limit to double what Vite normally requires, seems to be disabling minification and sourcemaps. Adding this to my viteFinal allows the build to work with just a 4gb memory limit.
Unfortunately, I want sourcemaps and disabling minification along is not enough so I'm not sure I'll use this workaround. |
I have meet the same issue |
Hello! I have the same problem since I updated to the latest version storybook/builder-vite (0.2.2). Everything works well before this update. If I revert this, it works perfectly. Is this related ? |
@nkCreation what version were you using before? Did you upgrade vite at the same time? |
Note, you can use |
Sorry for the delay, was on holiday :) I am on a pod on a private gitlab using vite v3 (at the moment 3.0.9) :) |
The error I have :
|
I have meet the same issue.
|
It's not just us, unfortunately. The underlying issue in Vite has by far the most 👍 of any issue there: vitejs/vite#2433. |
@emewjin @IanVS if it does help, I was able to workaround this by disabling sourcemaps in my Vite config for storybook:
Also mentioned it here vitejs/vite#2433 (comment) |
@dantman this solution worked in my case |
Thanks to @EfstathiadisD and @nstanard from this thread: vitejs/vite/issues/2433(comment). They suggested to use
and used the next script for building in GitLab:
Packages versions on the moment of writing the comment:
|
What version of
vite
are you using?^2.9.12
System info and storybook versions
System:
OS: Linux 5.10 Ubuntu 21.10 21.10 (Impish Indri)
CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 1.22.17 - ~/.yarn/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
npmPackages:
@storybook/addon-a11y: ^6.5.8 => 6.5.8
@storybook/addon-actions: ^6.5.8 => 6.5.8
@storybook/addon-docs: ^6.5.8 => 6.5.8
@storybook/addon-essentials: ^6.5.8 => 6.5.8
@storybook/addon-links: ^6.5.8 => 6.5.8
@storybook/builder-vite: ^0.1.36 => 0.1.36
@storybook/node-logger: ^6.5.8 => 6.5.8
@storybook/preset-create-react-app: ^3.2.0 => 3.2.0
@storybook/react: ^6.5.8 => 6.5.8
Describe the Bug
I'm converting a CRAv4 project to Vite recently I tried building Storybook and found it fails with an out of memory error. I've been rebasing the Vite transition continually so I have a CRAv4/Webpack4 comparison of the same project.
It's not an infinite loop of some sort exhausting memory. If I build using
NODE_OPTIONS=--max_old_space_size=8192
(8gb) then it successfully builds. However building with the default or 4gb is not enough and the memory error occurs.This doesn't seem to be a Storybook or Vite issue but specifically a vite-builder one because:
Link to Minimal Reproducible Example
No response
Participation
The text was updated successfully, but these errors were encountered: