I've deployed my project and get a cryptic error: Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : https://vercel.link/serverless-function-size
-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.tsx34: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-elementinfo - 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 demandTraced Next.js server files in: 59.794msCreated all serverless functions in: 170.631msCollected static files (public/, static/, .next/static): 18.071msInstalling 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?
I even tried rolling back my git history to the last working deployment and redeploying but even that didn't reset things. How can I find the culprit and fix it?