-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
12.0.9-canary.11 5x'd size of edge SSR bundle #34185
Comments
Hi, I do see that a chunk shoots up to 1.3MiB on 1.3 MiB [##########] 817.js
28.0 KiB [ ] 40.js
8.0 KiB [ ] 863.js
4.0 KiB [ ] 976.js
4.0 KiB [ ] 144.js
4.0 KiB [ ] font-manifest.json Is there any limitation for you to try 76.0 KiB [##########] 664.js
16.0 KiB [## ] 755.js
4.0 KiB [ ] 320.js
4.0 KiB [ ] 730.js
4.0 KiB [ ] font-manifest.json My wild guess is that the import in import { LoadComponentsReturnType } from './load-components' The current implementation is doing the proper way to bring a type, without bringing the entire module: import type { LoadComponentsReturnType } from './load-components' |
@icyJoseph Have you changed anything else when switching to For me, anything above |
To verify what I said above, run This is the result I got: |
Aha, now I got it. Confirmed. Somewhere, there's a Buffer being used! I think that explains Sorry for the initial misfire. It seems I had messed up the runtime value. I'll keep looking around. |
Hi all, thanks for reporting & looking into this! We are aware of the size increase, and we are work on optimizing the base server. Will keep this issue open for tracking. 🙏 |
Related to #34185, this PR reduces the size of chunk that contains web-server.ts from 1.14mb to 210.8kb, by splitting base-http and api-utils into different environments. Only affected thing is we can't have SSG preview mode for the web runtime via `getStaticProps`. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
@shuding I think this issue can be closed now, correct? |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Run
next info
(available from version 12.0.8 and up)What version of Next.js are you using?
12.0.9-canary.11
What version of Node.js are you using?
16.14.0
What browser are you using?
Chrome (latest)
What operating system are you using?
macOS (latest)
How are you deploying your application?
Vercel
Describe the Bug
12.0.9-canary.9
of Next.js comes with fairly small edge SSR bundles (∼ a few hundred KB in total).12.0.9-canary.10
doesn't exist on npm (FYI, just to clarify that there's no version in between).12.0.9-canary.11
made their size shoot up to over 1,3 MB (∼ x5) for just a single chunk.Initially, I assumed this would be a problem in my own application, but after hours of investigation, I got to understand that version
12.0.9-canary.9
of Next.js didn't have this problem, and that12.0.9-canary.11
had introduced it.It was probably caused by #33635, is my guess.
Analysis of version
12.0.9-canary.11
Analysis of version
12.0.9-canary.9
Expected Behavior
It seems unintentional that the size of individual edge SSR bundles was increased by 5x, just to support the expected functionality when rendering.
It'd be great if they'd return to a size that's closer to their original one, since a larger bundle effects the server-rendering performance (that's part of the reason why Cloudflare Workers [and probably others too] limit them to 1 MB by default, which is now being exceeded as of
12.0.9-canary.11
).Also note that next-rsc-demo worked just fine before
12.0.9-canary.11
. I understand that new functionality was added, but the penalty for that seems to be way too large.To Reproduce
next
dependency to12.0.9-canary.9
.next/server/chunks
have a "reasonable" sizenext
dependency to12.0.9-canary.11
.next/server/chunks
have suddenly shot up to over 1 MB for one chunkThe text was updated successfully, but these errors were encountered: