heygen-com/hyperframes · error

lint endpoint returned ${response.status}

Error message

lint endpoint returned ${response.status}

What it means

Thrown by fetchStudioLint when the Studio preview server's /api/projects/<projectName>/lint endpoint returns a non-OK HTTP status. This endpoint runs the composition linter server-side and returns lint results. A non-OK response means the lint route itself failed, not that the composition has lint errors (those return 200 with error entries in the body).

Source

Thrown at packages/cli/src/utils/studioSelectionClient.ts:155

  server: ActiveServer,
  fetchImpl: typeof fetch = fetch,
): Promise<StudioSelectionResponse> {
  const url = studioSelectionUrl(server);
  const response = await fetchImpl(url);
  if (!response.ok) {
    throw new Error(`selection endpoint returned ${response.status}`);
  }
  return (await response.json()) as StudioSelectionResponse;
}

export async function fetchStudioLint(
  server: ActiveServer,
  fetchImpl: typeof fetch = fetch,
): Promise<StudioLintResponse> {
  const url = studioApiUrl(server, "lint");
  const response = await fetchImpl(url);
  if (!response.ok) {
    throw new Error(`lint endpoint returned ${response.status}`);
  }
  return (await response.json()) as StudioLintResponse;
}

View on GitHub (pinned to c2996c8626)

Solutions

  1. Restart the Studio preview server.
  2. Update both CLI and Studio to the latest version to ensure the lint route exists.
  3. Run hyperframes lint directly (without the Studio server) as a fallback.
  4. Check the Studio server console for the stack trace of the route handler failure.
Defensive patterns

Strategy: try-catch

Validate before calling

async function isLintEndpointHealthy(server: ActiveServer): Promise<boolean> {
  try {
    const res = await fetch(studioApiUrl(server, "lint"), { signal: AbortSignal.timeout(5000) });
    return res.ok;
  } catch {
    return false;
  }
}

Try / catch

try {
  const lint = await fetchStudioLint(server);
} catch (err) {
  if (err instanceof Error && err.message.includes("lint endpoint")) {
    // Fall back to CLI-side linting without the Studio server
    console.warn(`Studio lint endpoint unhealthy. Running standalone lint.`);
    return runStandaloneLint();
  }
  throw err;
}

Prevention

When it happens

Trigger: The lint route handler threw an unhandled exception server-side; the project name doesn't match; the Studio server is in a degraded state; the server version doesn't have the lint route yet (older version).

Common situations: Running an older Studio server that predates the lint route; the server crashed partially; a bug in the server-side linter for a specific composition structure.

Related errors


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