heygen-com/hyperframes · error · Error

--skip-build set but ${zip} does not exist. Run `bun run --c

Error message

--skip-build set but ${zip} does not exist. Run `bun run --cwd packages/aws-lambda build:zip` first or drop --skip-build.

What it means

Thrown by runDeploy when `--skip-build` is set but the prebuilt handler ZIP at `<repoRoot>/packages/aws-lambda/dist/handler.zip` does not exist. --skip-build is an optimization for CI that already built the ZIP; this guard prevents a misleading later `sam deploy` failure by checking the artifact is actually present before proceeding.

Source

Thrown at packages/cli/src/commands/lambda/deploy.ts:58

    awsProfile: args.awsProfile ?? process.env.AWS_PROFILE,
    reservedConcurrency: args.reservedConcurrency ?? DEFAULT_CONCURRENCY,
    chromeSource: args.chromeSource ?? "sparticuz",
    lambdaMemoryMb: args.lambdaMemoryMb ?? DEFAULT_MEMORY_MB,
    skipBuild: args.skipBuild ?? false,
  };

  const root = repoRoot();
  // Locate the SAM template up-front so users get a fast, clear error
  // (not an opaque `sam deploy` failure) when this isn't a checkout.
  locateSamTemplate(root);

  if (!resolved.skipBuild) {
    console.log(c.dim("→ Building handler ZIP"));
    buildHandlerZip(root);
  } else {
    const zip = join(root, "packages", "aws-lambda", "dist", "handler.zip");
    if (!existsSync(zip)) {
      throw new Error(
        `--skip-build set but ${zip} does not exist. Run \`bun run --cwd packages/aws-lambda build:zip\` first or drop --skip-build.`,
      );
    }
  }

  console.log(c.dim(`→ sam deploy (stack=${resolved.stackName} region=${resolved.region})`));
  samDeploy({
    repoRoot: root,
    stackName: resolved.stackName,
    region: resolved.region,
    awsProfile: resolved.awsProfile,
    reservedConcurrency: resolved.reservedConcurrency,
    lambdaMemoryMb: resolved.lambdaMemoryMb,
    chromeSource: resolved.chromeSource,
  });

  console.log(c.dim("→ Reading stack outputs"));
  const outputs = fetchStackOutputs({

View on GitHub (pinned to c2996c8626)

Solutions

  1. Run `bun run --cwd packages/aws-lambda build:zip` once to produce the ZIP, then re-run deploy with --skip-build.
  2. Drop `--skip-build` and let the deploy command build the ZIP for you.
  3. In CI, ensure the build step runs (and succeeds) before the deploy step that uses --skip-build.

Example fix

# before
hyperframes lambda deploy --skip-build  # ZIP missing
# after — either build first
bun run --cwd packages/aws-lambda build:zip && hyperframes lambda deploy --skip-build
# or just let deploy build it
hyperframes lambda deploy
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the handler ZIP exists before using --skip-build
import { existsSync } from "node:fs";
import { join } from "node:path";
function assertZipReady(repoRoot: string): void {
  const zip = join(repoRoot, "packages", "aws-lambda", "dist", "handler.zip");
  if (!existsSync(zip)) throw new Error(`Build the ZIP first: bun run --cwd packages/aws-lambda build:zip`);
}

Try / catch

try {
  await runDeploy({ skipBuild: true, /* ... */ });
} catch (err) {
  if (/--skip-build set but/.test((err as Error).message))) {
    // drop --skip-build, or run build:zip first
  }
}

Prevention

When it happens

Trigger: Running `hyperframes lambda deploy --skip-build` before ever running the build:zip script; running from a fresh checkout where dist/ isn't populated; the ZIP was gitignored and a fresh clone lacks it.

Common situations: A CI job split into build + deploy steps where the build step was skipped or failed silently; copying only source between machines; a clean that removed dist/.

Related errors


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