heygen-com/hyperframes · error · Error

[lambda] stack ${opts.stackName} is missing one of RenderBuc

Error message

[lambda] stack ${opts.stackName} is missing one of RenderBucketName/RenderFunctionArn/RenderStateMachineArn. Got keys: ${[...byKey.keys()].join(", ")}

What it means

Thrown by fetchStackOutputs() in packages/cli/src/commands/lambda/sam.ts:177. After deploy, it queries `aws cloudformation describe-stacks` and expects three specific outputs: RenderBucketName, RenderFunctionArn, RenderStateMachineArn. If any is missing (or empty) it throws, listing the keys actually present so you can see what the stack exported instead.

Source

Thrown at packages/cli/src/commands/lambda/sam.ts:178

    opts.stackName,
    "--region",
    opts.region,
    "--query",
    "Stacks[0].Outputs",
    "--output",
    "json",
  ];
  if (opts.awsProfile) {
    args.unshift("--profile", opts.awsProfile);
  }
  const out = execFileSync("aws", args, { encoding: "utf-8" });
  const parsed = JSON.parse(out) as { OutputKey: string; OutputValue: string }[];
  const byKey = new Map(parsed.map((o) => [o.OutputKey, o.OutputValue]));
  const bucketName = byKey.get("RenderBucketName");
  const functionName = byKey.get("RenderFunctionArn");
  const stateMachineArn = byKey.get("RenderStateMachineArn");
  if (!bucketName || !functionName || !stateMachineArn) {
    throw new Error(
      `[lambda] stack ${opts.stackName} is missing one of RenderBucketName/RenderFunctionArn/RenderStateMachineArn. Got keys: ${[...byKey.keys()].join(", ")}`,
    );
  }
  return {
    bucketName,
    // RenderFunctionArn is the full ARN; the Lambda function name is the
    // last colon-segment, which downstream `getRenderProgress` calls use
    // for cost math + CloudWatch lookups.
    functionName: functionName.split(":").pop() ?? functionName,
    stateMachineArn,
  };
}

View on GitHub (pinned to c2996c8626)

Solutions

  1. Inspect the printed 'Got keys:' list — if the three expected keys are absent or renamed, the deployed template differs from what HyperFrames expects.
  2. Redeploy from the current examples/aws-lambda/template.yaml (the one matching your CLI version).
  3. Verify --stack-name points at the HyperFrames render stack, not the SAM managed-default stack or an unrelated app.
  4. Run `aws cloudformation describe-stacks --stack-name <name> --query 'Stacks[0].Outputs'` manually to compare.

Example fix

# inspect actual outputs
aws cloudformation describe-stacks --stack-name <name> --region us-east-1 \
  --query 'Stacks[0].Outputs' --output table
# then redeploy from the matching template if outputs are missing
Defensive patterns

Strategy: validation

Validate before calling

import { execFileSync } from 'node:child_process';

const REQUIRED_OUTPUTS = ['RenderBucketName', 'RenderFunctionArn', 'RenderStateMachineArn'];

function stackHasRequiredOutputs(name: string, region: string): boolean {
  const out = execFileSync('aws', [
    'cloudformation', 'describe-stacks', '--stack-name', name,
    '--region', region, '--query', 'Stacks[0].Outputs', '--output', 'json',
  ], { encoding: 'utf-8' });
  const keys = new Set((JSON.parse(out) as { OutputKey: string }[]).map((o) => o.OutputKey));
  return REQUIRED_OUTPUTS.every((k) => keys.has(k));
}

Try / catch

try {
  fetchStackOutputs(opts);
} catch (error) {
  if (/is missing one of/.test(String(error))) {
    // re-run describe-stacks, inspect actual keys, redeploy from matching template
    throw new Error('Deployed template is missing expected outputs — redeploy from the current template.yaml');
  }
  throw error;
}

Prevention

When it happens

Trigger: fetchStackOutputs against a stack whose template doesn't export those three outputs — e.g. an older template revision, a user-customized template that renamed/removed outputs, a partial deploy, or pointing --stack-name at the wrong stack.

Common situations: Template version mismatch (deployed an older examples/aws-lambda/template.yaml that lacks the outputs); user edited outputs in a forked template; querying a stack created by a different tool; CloudFormation deploy partially succeeded and outputs weren't all materialized.

Related errors


AI-assisted analysis of heygen-com/hyperframes@c2996c8626 (2026-08-12). Data as JSON: /api/errors/ddb7e8bea649ddfb. Report an issue: GitHub.