NITRO_PRESET=vercel-edge build output is too large with 2.8.3+
Environment
- Operating System:
Darwin - Node Version:
v18.17.1 - Nuxt Version:
3.8.1 - CLI Version:
3.9.1 - Nitro Version:
2.7.2 - Package Manager:
[email protected] - Builder:
- - User Config:
srcDir,appConfig,modules,nitro,css,pwa,devtools,colorMode,content - Runtime Modules:
@nuxtjs/[email protected],@nuxtjs/[email protected],@nuxt/[email protected],[email protected],@vite-pwa/[email protected],@nuxt/[email protected] - Build Modules:
-
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
related issue https://github.com/nuxt/content/issues/2422
Can anyone tell us which code actually affects this 1MB limit?
Is it just server/ folder or other back-end logic on pages too?
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?
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.