error - DeployBuild job failed [unexpected]: Error in xdn-deploy-lambda: Unzipped size must be smaller than 262144000 bytes
Fails during deployment. Build and run works fine locally.
error - DeployBuild job failed [unexpected]: Error in xdn-deploy-lambda: Unzipped size must be smaller than 262144000 bytes
Fails during deployment. Build and run works fine locally.
As the error states, there is an upper limit on how big a package can be when deployed to our serverless infrastructure. Some common strategies for solving:
import {get} from lodash
to import { get} from lodash/get
to avoid unnecessary bloat in your modulesconfig.optimization.minimize = true;
to your next.config.js
You can view what is included in your package under .xdn/lambda/
after a build, and running du -h -d 1
on the directories in a shell will output the size of each directory and help you identify where space savings can be found, ie du -h -d 1 .xdn/lambda/.next/serverless/pages
@patrick.saweikis I’m interested in what library overran the limit in this specific case. Generally Next.js does a very good job of keeping the serverless build small. It can be a bit more challenging in Nuxt, but I’m surprised that you ran into this issue with a Next.js app.