heygen-com/hyperframes · error · Error
[hyperframes lambda] could not find the repo root (no packag
Error message
[hyperframes lambda] could not find the repo root (no packages/aws-lambda/ above this CLI's source). Run `hyperframes lambda` from within a hyperframes checkout, or set HYPERFRAMES_REPO_ROOT explicitly.
What it means
Thrown by repoRoot() when it cannot locate the HyperFrames repository root — i.e. a directory containing `packages/aws-lambda/package.json` — within 12 ancestor levels of this source file, AND no valid HYPERFRAMES_REPO_ROOT override is set. The `lambda deploy`/`destroy` commands need the repo root to find the SAM template and the handler ZIP build script, so when the CLI is invoked from outside a checkout (e.g. a globally-installed CLI) and no override is given, this fires with an actionable hint.
Source
Thrown at packages/cli/src/commands/lambda/repoRoot.ts:29
import { existsSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
export function repoRoot(): string {
const override = process.env.HYPERFRAMES_REPO_ROOT;
if (override && existsSync(resolve(override, "packages", "aws-lambda", "package.json"))) {
return override;
}
let dir = dirname(fileURLToPath(import.meta.url));
for (let depth = 0; depth < 12; depth++) {
if (existsSync(resolve(dir, "packages", "aws-lambda", "package.json"))) {
return dir;
}
const parent = dirname(dir);
if (parent === dir) break;
dir = parent;
}
throw new Error(
"[hyperframes lambda] could not find the repo root (no packages/aws-lambda/ above this CLI's source). " +
"Run `hyperframes lambda` from within a hyperframes checkout, or set HYPERFRAMES_REPO_ROOT explicitly.",
);
}
View on GitHub (pinned to c2996c8626)
Solutions
- Run `hyperframes lambda` from within a HyperFrames checkout (`git clone` first if needed).
- Set HYPERFRAMES_REPO_ROOT to the absolute path of your checkout root: `export HYPERFRAMES_REPO_ROOT=/path/to/hyperframes`.
- Verify the override resolves: the directory must contain `packages/aws-lambda/package.json`.
Example fix
# before hyperframes lambda deploy # run from outside the repo # after — point at the checkout export HYPERFRAMES_REPO_ROOT=/src/hyperframes hyperframes lambda deploy
Defensive patterns
Strategy: validation
Validate before calling
// Confirm repo root is discoverable before invoking lambda deploy/destroy
import { existsSync } from "node:fs";
import { resolve } from "node:path";
function assertRepoRootKnown(): string {
const override = process.env.HYPERFRAMES_REPO_ROOT;
const root = override ?? process.cwd();
if (!existsSync(resolve(root, "packages", "aws-lambda", "package.json"))) {
throw new Error("Set HYPERFRAMES_REPO_ROOT to a HyperFrames checkout");
}
return root;
} Try / catch
try {
const root = repoRoot();
} catch (err) {
if (/could not find the repo root/.test((err as Error).message))) {
process.env.HYPERFRAMES_REPO_ROOT = "/path/to/hyperframes";
// retry
}
} Prevention
- Set HYPERFRAMES_REPO_ROOT in your shell/DOTENV for any environment running `lambda deploy`.
- Clone the full HyperFrames repo rather than installing the CLI globally for Lambda workflows.
- Verify the override contains packages/aws-lambda/package.json before invoking.
When it happens
Trigger: Running `hyperframes lambda deploy` or `lambda destroy` from a globally-installed CLI that isn't inside a HyperFrames repo checkout, with HYPERFRAMES_REPO_ROOT unset or pointing somewhere without packages/aws-lambda/.
Common situations: `npm install -g hyperframes` and then running `lambda deploy` from an unrelated project directory; the override env var points at a stale path; running inside a container that only mounted part of the repo.
Related errors
- `sam` CLI not found on PATH. Install AWS SAM CLI from https:
- --skip-build set but ${zip} does not exist. Run `bun run --c
- [lambda deploy] handler ZIP build exited with code ${result.
- `aws` CLI not found on PATH. Install from https://docs.aws.a
- [chromium] Chrome binary unavailable (source=${source}): HYP
AI-assisted analysis of heygen-com/hyperframes@c2996c8626 (2026-08-12).
Data as JSON: /api/errors/ba3e945b6b01a007.
Report an issue: GitHub.