{"record":{"id":"abfbc54dbbcae996","repo":"remotion-dev/remotion","slug":"payload-is-too-big-stringifiedpayload-length-b","errorCode":null,"errorMessage":"Payload is too big: ${stringifiedPayload.length} bytes. Maximum size is 256 KB. This should not happen, please report this to the Remotion team. Payload: ${stringifiedPayload}","messagePattern":"Payload is too big: (.+?) bytes\\. Maximum size is 256 KB\\. This should not happen, please report this to the Remotion team\\. Payload: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/lambda-client/src/call-lambda-async.ts","lineNumber":21,"sourceCode":"\tCallFunctionOptions,\n\tCloudProvider,\n\tServerlessRoutines,\n} from '@remotion/serverless-client';\nimport {getLambdaClient} from './aws-clients';\nimport type {AwsRegion} from './regions';\n\nexport const callFunctionAsyncImplementation = async <\n\tT extends ServerlessRoutines,\n\tProvider extends CloudProvider,\n>({\n\tfunctionName,\n\tpayload,\n\tregion,\n\ttimeoutInTest,\n}: CallFunctionOptions<T, Provider>): Promise<void> => {\n\tconst stringifiedPayload = JSON.stringify(payload);\n\tif (stringifiedPayload.length > 256 * 1024) {\n\t\tthrow new Error(\n\t\t\t`Payload is too big: ${stringifiedPayload.length} bytes. Maximum size is 256 KB. This should not happen, please report this to the Remotion team. Payload: ${stringifiedPayload}`,\n\t\t);\n\t}\n\n\tconst result = await getLambdaClient(\n\t\tregion as AwsRegion,\n\t\ttimeoutInTest,\n\t\tnull,\n\t).send(\n\t\tnew InvokeCommand({\n\t\t\tFunctionName: functionName,\n\t\t\tPayload: stringifiedPayload,\n\t\t\tInvocationType: 'Event',\n\t\t}),\n\t);\n\n\tif (result.FunctionError) {\n\t\tthrow new Error(","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-client/src/call-lambda-async.ts#L3-L39","documentation":"Thrown by callFunctionAsyncImplementation() in @remotion/lambda-client when the JSON-serialized payload sent to a Lambda function (InvocationType 'Event' / async invocation) exceeds 256 KB. AWS Lambda caps the async invocation payload at 256 KB; beyond that the Invoke API rejects the call before execution. The message labels this as a defect ('This should not happen, please report this to the Remotion team') because Remotion is supposed to have already offloaded large inputs to S3 (serve URL / input props in S3) so the inline payload stays small.","triggerScenarios":"Passing very large inputProps directly inline to renderMediaOnLambda()/renderStillOnLambda() instead of referencing a serve URL, embedding large base64-encoded assets in props, or shipping a huge serialized composition tree.","commonSituations":"Inlining a base64 image or long text corpus in inputProps; passing the whole composition JSON; rendering from a serve source that itself serializes a lot of data into the launch payload; upgrading to a version that changed payload chunking.","solutions":["Move large data into S3 and pass a serve URL / props URL instead of inline inputProps.","Reduce the size of inputProps: strip unused fields, avoid base64 blobs, reference assets by URL.","Use renderMediaOnLambda with a deployed serve source (serveUrl) and keep inputProps minimal.","If you believe the payload should be small, file a Remotion issue with the payload size and structure."],"exampleFix":"// before\nawait renderMediaOnLambda({\n  serveUrl: 'bundle',\n  inputProps: { hugeBase64Image: 'data:image/png;base64,iVBOR...' }, // >256KB\n});\n\n// after\n// Upload the image to S3 and pass its URL\nawait renderMediaOnLambda({\n  serveUrl: 'bundle',\n  inputProps: { imageUrl: 'https://my-bucket.s3.amazonaws.com/image.png' },\n});","handlingStrategy":"validation","validationCode":"const serialized = JSON.stringify(inputProps);\nif (serialized.length > 200_000) {\n  throw new Error('inputProps too large; move data to S3 and pass a URL');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await renderMediaOnLambda({ ... });\n} catch (e) {\n  if (String((e as Error).message).includes('Payload is too big')) {\n    // move large props to S3, then retry with a slim inputProps referencing the S3 URL\n  } else throw e;\n}","preventionTips":["Keep inputProps small: reference assets by URL, never inline base64 blobs.","Use a deployed serve source and pass only minimal per-render props.","Assert the serialized size of inputProps before calling the Lambda API."],"tags":["lambda-client","payload","size-limit","aws-lambda","input-props","s3"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}