-
-
Notifications
You must be signed in to change notification settings - Fork 37
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 static pages with dynamic routes results in oversized server.js #362
Comments
Same issue here with nextjs |
Right so this is a case we're not handing well, but I'm surprised we're handing it that badly... Just out of interest, can you run It should look like:
|
I've removed most of the pages for speed/readability and it still generates a 9.13MB server.js. The most interesting thing here I think is the size of the serverless
|
correct me if I'm wrong, but I don't see any dynamic routes? Can you run a |
Including dynamic routes (9.24MB):
|
Wow ok. Do me one more test? Delete all the (you can leave the dynamic routes there, I don't think they're the cause of the bloat) |
Still off by a factor of 10, sadly: |
Ok! I will investigate, thanks. (currently looking at what bloats the JS case so will circle back to this) |
Can you please test something for me?
Note existing size of server.js
Did a) build succeed and b) how big is server.js now? If it did build, does
What's the final minified size? |
Original build:
Updated packages dont build for me:
|
Also, I couldn't run the dev server on the original. (webpack5)
|
Damn, ok. Could you share your code with me somehow? Join the discord and DM me? https://discord.gg/Qvj3pJY |
@geelen I tested the above commands using a fresh Next.js project: Before your commits: After your commits without minifying: After your commit with minifying: |
Interesting, what fresh Next project template did you use? I didn't see |
@geelen can reproduce with: $ npx create-next-app
$ cd example-app
$ npx fab init
$ npm run build:fab
...
[Generator] Created fab.zip (1.6 MB) in 0.21 seconds |
NextJS compilation target has been set to
serverless
. Fab builds without issues aside from extremely largeserver.js
in resulting bundle. This prevents a deploy to Cloudflare as there is a 1MB worker size limit.The text was updated successfully, but these errors were encountered: