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

NextJS installation size is extremely big #32252

Closed
abriginets opened this issue Dec 7, 2021 · 3 comments
Closed

NextJS installation size is extremely big #32252

abriginets opened this issue Dec 7, 2021 · 3 comments
Labels
bug Issue was opened via the bug report template.

Comments

@abriginets
Copy link

What version of Next.js are you using?

12.0.7

What version of Node.js are you using?

14.18.2

What browser are you using?

What operating system are you using?

WSL 2

How are you deploying your application?

Heroku

Describe the Bug

I was trying to deploy my NextJS app to Heroku and I mentioned that my slug size is too big even in compressed state. I downloaded the slug and it appears that NextJS takes the most space:
image

Mostly because swc binaries are bundled for all possible operating systems and archs. @ijjk does that makes sense to determine OS and processor arch in preinstall phase and download only required binaries?
image

Expected Behavior

NextJS should determine which OS and processor arch developer is using and download only what's required in preinstall phase. Or maybe do not install anything at all if Babel config is detected in the repo.

To Reproduce

@abriginets abriginets added the bug Issue was opened via the bug report template. label Dec 7, 2021
kodiakhq bot pushed a commit that referenced this issue Dec 7, 2021
This adds documentation to explain how the `outputStandalone` config can be leveraged to reduce production deployment size and leverage the output file traces.  This also adds a note for the `outputFileTracingRoot` config as it may be needed in some monorepo setups. 

A follow-up PR will update our Docker example to leverage this config as well. 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: #31003
x-ref: #32252
Closes: #30822
@balazsorban44
Copy link
Member

Duplicate of #32183

@balazsorban44 balazsorban44 marked this as a duplicate of #32183 Dec 7, 2021
@carlosbaraza
Copy link

Workaround: #32183 (comment)

kodiakhq bot pushed a commit that referenced this issue Dec 13, 2021
This updates our docker example to leverage the output traces and standalone build to reduce the resulting docker image quite a bit. 

docker image size before: `272MB`
docker image size after: `121MB`
node-14:alpine size (base image): `118MB`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: #32255
x-ref: #32252
x-ref: #30822
cdierkens pushed a commit to cdierkens/next.js that referenced this issue Dec 20, 2021
This updates our docker example to leverage the output traces and standalone build to reduce the resulting docker image quite a bit. 

docker image size before: `272MB`
docker image size after: `121MB`
node-14:alpine size (base image): `118MB`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: vercel#32255
x-ref: vercel#32252
x-ref: vercel#30822
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants