content icon indicating copy to clipboard operation
content copied to clipboard

NITRO_PRESET=vercel-edge build output is too large with 2.8.3+

Open yyyanghj opened this issue 2 years ago • 4 comments

Environment

Reproduction

https://github.com/yyyanghj/nuxt-3-7-4

Describe the bug

Vercel hobby plan has 1MB(gzip) limit size for the edge function. The minimal production build output size is 1.6+ MB(gzip).

2.8.3

1.66 MB gzip

ℹ Building Nitro Server (preset: vercel-edge)                                                       nitro 4:47:44 AM
✔ Nitro server built                                                                                nitro 4:48:06 AM
  └─ .vercel/output/functions/__nitro.func/index.mjs (7.91 MB) (1.66 MB gzip)
Σ Total size: 7.91 MB (1.66 MB gzip)

2.8.2

516 kB gzip

ℹ Building Nitro Server (preset: vercel-edge)                                                       nitro 4:46:52 AM
✔ Nitro server built                                                                                nitro 4:47:08 AM
  └─ .vercel/output/functions/__nitro.func/index.mjs (1.92 MB) (516 kB gzip)
Σ Total size: 1.92 MB (516 kB gzip)

Additional context

No response

Logs

No response

yyyanghj avatar Nov 18 '23 20:11 yyyanghj

related issue https://github.com/nuxt/content/issues/2422

yyyanghj avatar Nov 18 '23 20:11 yyyanghj

Can anyone tell us which code actually affects this 1MB limit?

Is it just server/ folder or other back-end logic on pages too?

PixsaOJ avatar Jan 07 '24 17:01 PixsaOJ

Hey there, I was having the same issue this morning. I had a look in .vercel/output/functions/__nitro.func/index.mjs having run nuxi build and I had about 10 SVG components that I had made into server components. Not sure why I did that tbh??? I must have been having a moment?? Anyways, I removed the server prefix and this reduce the output file for vercel_edge preset from 1.03MB to around 560kB. Possibly have a look at the components directory & unused CSS?

Peggy535 avatar Apr 06 '24 15:04 Peggy535

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Aug 21 '24 01:08 github-actions[bot]