I’ve deployed my project and get a cryptic error:
Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : Troubleshooting Build Error: “Serverless Function has exceeded the unzipped maximum size of 250 MB”
-No information as to which function in particular .
I’ve added outputfiletracing to the next.config- don’t know which paths to exclude because i can’t see where the issue is. The log on build is:
./components/ui/related_articles.tsx
34:9 Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/app/api-reference/config/eslint#disabling-rules
Collecting page data ...
Generating static pages (0/23) ...
generating sitemap data
Generating static pages (5/23)
sitemap data generated successfully
Generating static pages (11/23)
Generating static pages (17/23)
✓ Generating static pages (23/23)
Finalizing page optimization ...
Collecting build traces ...
Route (app) Size First Load JS
┌ ○ / 10.4 kB 191 kB
├ ○ /_not-found 990 B 103 kB
├ ○ /about 5.74 kB 149 kB
└ ○ /sitemap.xml 141 B 102 kB
+ First Load JS shared by all 102 kB
├ chunks/1684-99765a90fe2aba6a.js 46.4 kB
├ chunks/4bd1b696-bf14931f48e91d91.js 53.2 kB
└ other shared chunks (total) 2.02 kB
ƒ Middleware 33.2 kB
○ (Static) prerendered as static content
ƒ (Dynamic) server-rendered on demand
Traced Next.js server files in: 59.794ms
Created all serverless functions in: 170.631ms
Collected static files (public/, static/, .next/static): 18.071ms
Installing required dependencies...
Build Completed in /vercel/output [2m]
Deploying outputs...
Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : https://vercel.link/serverless-function-size
My config file:
/** @type {import('next').NextConfig} */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const nextConfig = {
outputFileTracingExcludes: { '/': ['.git', '.next/cache'],},
rewrites: async () => {
return [
{
source: "/api/:path*",
destination:
process.env.NODE_ENV === "development"
? "http://127.0.0.1:8000/api/:path*"
: "/api/",
},
{
source: "/docs",
destination:
process.env.NODE_ENV === "development"
? "http://127.0.0.1:8000/docs"
: "/api/docs",
},
{
source: "/openapi.json",
destination:
process.env.NODE_ENV === "development"
? "http://127.0.0.1:8000/openapi.json"
: "/api/openapi.json",
},
];
},
};
module.exports =withBundleAnalyzer( nextConfig);
Can anyone help with this?