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
- Run `bun run --cwd packages/aws-lambda build:zip` once to produce the ZIP, then re-run deploy with --skip-build.
- Drop `--skip-build` and let the deploy command build the ZIP for you.
- 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
- Order CI steps: install → build:zip → deploy --skip-build.
- Don't use --skip-build for one-off local deploys; let deploy build the ZIP.
- Commit or cache dist/handler.zip in CI to keep --skip-build valid.
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
- [lambda deploy] handler ZIP build exited with code ${result.
- [hyperframes lambda] could not find the repo root (no packag
- `sam` CLI not found on PATH. Install AWS SAM CLI from https:
- [lambda] ${flagName} must be a positive integer; got ${n}
- ${errorPrefix} must be ${allowed.join("|")}; got ${s}
AI-assisted analysis of heygen-com/hyperframes@c2996c8626 (2026-08-12).
Data as JSON: /api/errors/ae74e2a47866321b.
Report an issue: GitHub.