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

[Bug]: node_modules is 660mb bigger due to @swc and @esbuild packages #24375

Closed
bbellmyers opened this issue Oct 4, 2023 · 7 comments
Closed

Comments

@bbellmyers
Copy link

bbellmyers commented Oct 4, 2023

Describe the bug

Just upgraded to latest Storybook and now my node_modules is huge, primarily due to the new @swc and @esbuild packages. This is breaking my CI system due to the huge build images required. What can be done to trim this back?

To Reproduce

install Storybook. Note node_modules size.

node_modules % du -sk * | sort -rnk1
404140 @swc
202700 @esbuild
54668 @storybook

System

Environment Info:

  System:
    OS: macOS 13.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
    Yarn: 1.22.0 - /usr/local/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
  Browsers:
    Edge: 117.0.2045.47
    Safari: 16.6
  npmPackages:
    @storybook/addon-a11y: 7.2.2 => 7.2.2 
    @storybook/addon-essentials: 7.2.2 => 7.2.2 
    @storybook/addon-interactions: 7.2.2 => 7.2.2 
    @storybook/addon-links: 7.2.2 => 7.2.2 
    @storybook/addon-styling: 1.3.5 => 1.3.5 
    @storybook/blocks: 7.2.2 => 7.2.2 
    @storybook/react: 7.2.2 => 7.2.2 
    @storybook/react-webpack5: 7.2.2 => 7.2.2 
    @storybook/testing-library: 0.0.14-next.2 => 0.0.14-next.2

Additional context

No response

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Oct 5, 2023

Hi @bbellmyers,

Thank you for the bug report!

I tried to verify the numbers on a React 18 (Webpack) project, and here are my stats (in kilobytes):

73668 @storybook
34620 @swc
14908 @babel
9296 @esbuild

Could you provide a reproduction or tell me which renderer and builder you are using? I will try to figure out, whether I can reproduce your numbers.

@o-alexandrov
Copy link

o-alexandrov commented Oct 14, 2023

@bbellmyers That's an issue in Yarn v1 described here; you either need to upgrade Yarn or switch to another modern package manager.

@valentinpalkovic to reproduce the issue, you'd need to use yarn v1.

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Oct 14, 2023

@o-alexandrov Thanks for letting us know!

In that case, we cannot do much but advise people to upgrade to yarn 2/3. I am closing this issue. @bbellmyers Let me know if the problem occurs with other package managers except of yarn 1.

@bbellmyers
Copy link
Author

I am using npm

@o-alexandrov
Copy link

o-alexandrov commented Oct 14, 2023

@bbellmyers platform-specific packages that are not for your operating system are ignored in your specified npm 8 version.
You might want to try to attempt reproduce the issue with an example project that was mentioned in a prior comment.

  • once it confirms you have no issues with npm 8 in an example boilerplate, then you should look at the contents of your package-lock.json file for the duplicate libraries

Copy link
Contributor

github-actions bot commented Nov 7, 2023

Hi there! Thank you for opening this issue, but it has been marked as stale because we need more information to move forward. Could you please provide us with the requested reproduction or additional information that could help us better understand the problem? We'd love to resolve this issue, but we can't do it without your help!

@github-actions github-actions bot added the Stale label Nov 7, 2023
Copy link
Contributor

I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists – we're always happy to help. Thanks so much for your understanding.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants