Lambda deployment exceeds 250MB limit in Remotion 4.0.431
Summary
deployFunction() fails with InvalidParameterValueException because the Lambda function + layers exceed the AWS limit. The package is ~6.2 MB over the 250 MB ceiling.
Environment
- Remotion version: 4.0.431 (upgraded from 4.0.356)
- Packages:
@remotion/lambda,@remotion/bundler,@remotion/renderer, etc. - Chromium layer:
@sparticuz/chromium^143.0.0 - Node.js: v22.14.0
- OS: macOS (darwin 25.3.0)
- AWS Region: us-east-1
Exact Error
InvalidParameterValueException: Function code combined with layers exceeds the maximum allowed size of 262144000 bytes. The actual size is 268354806 bytes.
| Metric | Value |
|---|---|
| AWS limit | 262,144,000 bytes (250 MB) |
| Actual size | 268,354,806 bytes (~256 MB) |
| Exceeded by | ~6.2 MB |
Stack Trace
at AwsRestJsonProtocol.handleError (file:///.../node_modules/@remotion/lambda-client/dist/esm/index.mjs:16508:25)
...
at async Object.createFunction (file:///.../node_modules/@remotion/lambda/dist/esm/index.mjs:9633:41)
at async internalDeployFunction (file:///.../node_modules/@remotion/lambda/dist/esm/index.mjs:9988:19)
Steps to Reproduce
- Upgrade Remotion packages from 4.0.356 to 4.0.431
- Run:
node remotion-deploy.mjs - Deployment fails during
deployFunction()with the above error
Expected vs Actual
- Expected: Deployment succeeds within the 250 MB limit.
- Actual: Deployment fails because package + layers = ~256 MB (~6 MB over limit).
Regression
Deployment previously worked with Remotion 4.0.356. The upgrade to 4.0.431 introduces a package size increase that exceeds the AWS Lambda limit.
This seems to happen with --runtime-preference=apple-emojis only
Version 4.0.414 still worked for me even with --runtime-preference=apple-emojis. Does this mean we cannot use those emojis going forward?
No, it means we're gonna fix it in the next version!
This was just me thinking out loud, thanks for reporting!