{"record":{"id":"77988bb0df9a237b","repo":"heygen-com/hyperframes","slug":"rendertolambda-bucketname-is-required","errorCode":null,"errorMessage":"[renderToLambda] bucketName is required","messagePattern":"\\[renderToLambda\\] bucketName is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/aws-lambda/src/sdk/renderToLambda.ts","lineNumber":86,"sourceCode":"/** Stable identifier + every URL/ARN the caller needs to follow the render. */\nexport interface RenderHandle {\n  /** Same as the Step Functions execution name. */\n  renderId: string;\n  /** Full execution ARN; pass to {@link getRenderProgress}. */\n  executionArn: string;\n  bucketName: string;\n  stateMachineArn: string;\n  outputS3Uri: string;\n  projectS3Uri: string;\n  startedAt: string;\n}\n\n// fallow-ignore-next-line complexity\nexport async function renderToLambda(opts: RenderToLambdaOptions): Promise<RenderHandle> {\n  validateDistributedRenderConfig(opts.config);\n\n  if (!opts.bucketName) {\n    throw new Error(\"[renderToLambda] bucketName is required\");\n  }\n  if (!opts.stateMachineArn) {\n    throw new Error(\"[renderToLambda] stateMachineArn is required\");\n  }\n  if (!opts.siteHandle && !opts.projectDir) {\n    throw new Error(\"[renderToLambda] either siteHandle or projectDir must be supplied\");\n  }\n\n  const executionName = opts.executionName ?? `hf-render-${randomUUID()}`;\n  const ext = formatExtension(opts.config.format);\n  const outputKey = opts.outputKey ?? `renders/${executionName}/output${ext}`;\n  const planOutputS3Prefix = formatS3Uri({\n    bucket: opts.bucketName,\n    key: `renders/${executionName}/`,\n  });\n  const outputS3Uri = formatS3Uri({ bucket: opts.bucketName, key: outputKey });\n\n  const site =","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/aws-lambda/src/sdk/renderToLambda.ts#L68-L104","documentation":"Thrown by renderToLambda when opts.bucketName is empty/falsy. The bucket is the S3 destination for both the uploaded project tarball and the render output; every downstream URI is built from it. The check fires before any AWS call so a missing bucket surfaces at the SDK boundary rather than as an opaque S3 AccessDenied/NoSuchBucket later. bucketName normally comes from the SAM/CDK stack output RenderBucketName.","triggerScenarios":"Caller reads the stack output into an env var that isn't set; the stack output name changed; the field is passed as undefined from a config object that wasn't populated; a typo in the options key.","commonSituations":"SAM/CDK stack not deployed so the output is empty; reading process.env.HF_BUCKET_NAME before it's exported; passing { bucket: … } (wrong key) instead of { bucketName: … }.","solutions":["Confirm the SAM stack is deployed and read RenderBucketName from its outputs.","Assert the bucket is non-empty before calling renderToLambda: if (!bucketName) throw.","Check the options key spelling — it is bucketName, not bucket.","Log the stack outputs to verify the value is populated."],"exampleFix":"// before\nawait renderToLambda({ config, bucketName: process.env.HF_BUCKET, stateMachineArn });\n// HF_BUCKET unset -> empty string\n\n// after\nconst bucketName = requiredEnv('HF_BUCKET');\nawait renderToLambda({ config, bucketName, stateMachineArn });","handlingStrategy":"validation","validationCode":"function assertRequiredString(value: string | undefined, field: string): asserts value is string {\n  if (!value) throw new Error(`${field} is required`);\n}","typeGuard":"const isNonEmptyString = (v: unknown): v is string =>\n  typeof v === 'string' && v.length > 0;","tryCatchPattern":null,"preventionTips":["Read RenderBucketName from the deployed SAM/CDK stack outputs, not a hardcoded value.","Assert the env var is set at startup with a helper like requiredEnv().","Double-check the options key is bucketName (not bucket)."],"tags":["s3","validation","render","aws-lambda","config"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}