heygen-com/hyperframes · error · Error

Selected media has no analyzable local src

Error message

Selected media has no analyzable local src

What it means

Thrown by resolveMediaTreatmentSource() in packages/cli/src/commands/media-treatment.ts:495. It trims the src and throws this specific message when the result is empty, or (line 502) when cleanAssetUrl returns null. Analysis only operates on local project assets — remote/inline URLs are rejected separately. This is the empty/unresolvable-local-src branch.

Source

Thrown at packages/cli/src/commands/media-treatment.ts:495

}

function mediaSourceForElement(element: Element): string {
  const src =
    element.getAttribute("src") ??
    (element.tagName.toLowerCase() === "video"
      ? element.querySelector("source")?.getAttribute("src")
      : null);
  if (!src) throw new Error("Selected media has no analyzable src");
  return src;
}

export function resolveMediaTreatmentSource(
  projectDir: string,
  compositionFile: string,
  source: string,
): string {
  const sourceUrl = source.trim();
  if (!sourceUrl) throw new Error("Selected media has no analyzable local src");
  if (isRemoteOrInlineUrl(sourceUrl)) {
    throw new Error(
      "Media analysis requires a local project asset; freeze remote media with media-use first",
    );
  }
  const cleanSource = cleanAssetUrl(sourceUrl);
  if (!cleanSource) throw new Error("Selected media has no analyzable local src");
  const projectRelative = cleanSource.startsWith("/")
    ? cleanSource
    : rewriteAssetPath(compositionFile, cleanSource, (path) => existsSync(join(projectDir, path)));
  const asset = resolveExistingLocalAsset(projectDir, projectRelative);
  if (!asset) throw new Error(`Media file not found: ${source}`);
  return asset.resolved;
}

function parseGrading(raw: string | undefined, apply: boolean, clear: boolean): unknown {
  if (clear) {
    if (raw !== undefined || apply) {

View on GitHub (pinned to c2996c8626)

Solutions

  1. Give the element a real local project-relative src (e.g. 'assets/hero.mp4').
  2. Confirm the asset file exists under the project dir; if remote, run `hyperframes media-use` to freeze it locally first.
  3. Remove empty/placeholder src attributes before analysis.

Example fix

<!-- before -->
<video id="hero" src=""></video>
<!-- after -->
<video id="hero" src="assets/hero.mp4"></video>
Defensive patterns

Strategy: validation

Validate before calling

import { cleanAssetUrl, isRemoteOrInlineUrl } from '@hyperframes/parsers/asset-resolution';

function isAnalyzableLocalSrc(src: string): boolean {
  const trimmed = src.trim();
  if (!trimmed || isRemoteOrInlineUrl(trimmed)) return false;
  return cleanAssetUrl(trimmed) !== null;
}

Type guard

function isAnalyzableLocalSrc(src: string): boolean {
  const trimmed = src.trim();
  if (!trimmed) return false;
  if (isRemoteOrInlineUrl(trimmed)) return false;
  return cleanAssetUrl(trimmed) !== null;
}

Try / catch

try {
  resolveMediaTreatmentSource(projectDir, compositionFile, source);
} catch (error) {
  if (/no analyzable local src/.test(String(error))) {
    // set a real local asset path or freeze remote media first
    throw new Error('src is empty/inline/remote — point at a local project asset or run media-use first');
  }
  throw error;
}

Prevention

When it happens

Trigger: The element's src, after trim, is empty; or cleanAssetUrl cannot extract a usable local path from it (e.g. blank, malformed, or an inline asset URL that doesn't clean to a filesystem path). Remote URLs hit a different, more specific error.

Common situations: Empty src attribute; src containing only whitespace; src that's an inline/blob/data placeholder; src that cleanAssetUrl rejects as non-local before the remote check fires.

Related errors


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