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

  1. Run `hyperframes lambda` from within a HyperFrames checkout (`git clone` first if needed).
  2. Set HYPERFRAMES_REPO_ROOT to the absolute path of your checkout root: `export HYPERFRAMES_REPO_ROOT=/path/to/hyperframes`.
  3. 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

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


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