{"record":{"id":"b6a0927609074b5e","repo":"heygen-com/hyperframes","slug":"render-failed-for-variant-variant-label-va","errorCode":null,"errorMessage":"Render failed for variant \"${variant.label}\" (${variant.displayPath}): ${normalizeErrorMessage(err)}","messagePattern":"Render failed for variant \"(.+?)\" \\((.+?)\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/compare.ts","lineNumber":299,"sourceCode":"        renderReadyTimedOut,\n      } = await openSettledCompositionPage(html, server.url, {\n        renderReadyTimeoutMs: opts.timeoutMs,\n        renderReadyWarningSuffix: `comparison variant \"${variant.label}\" may be inaccurate`,\n      });\n      try {\n        if (opts.atSeconds > 0) {\n          await seekCompositionTimeline(page, opts.atSeconds);\n        }\n        await page.screenshot({ path: opts.framePath, type: \"png\" });\n        return { framePath: opts.framePath, renderReadyTimedOut };\n      } finally {\n        await chromeBrowser.close();\n      }\n    } finally {\n      await server.close();\n    }\n  } catch (err) {\n    throw new Error(\n      `Render failed for variant \"${variant.label}\" (${variant.displayPath}): ${normalizeErrorMessage(err)}`,\n    );\n  }\n}\n\nasync function renderCompareSheet(parsed: ParsedCompareArgs): Promise<CompareSuccessPayload> {\n  const capResult = capCompareVariants(parsed.variants);\n  const variants = capResult.variants;\n  const prepared = prepareCompareVariantProjects(variants);\n  const frameDir = mkdtempSync(join(tmpdir(), \"hf-compare-frames-\"));\n  const framePaths: string[] = [];\n\n  try {\n    let renderReadyTimedOut = false;\n    for (let i = 0; i < prepared.length; i++) {\n      const variant = prepared[i]!;\n      const framePath = join(frameDir, `variant-${String(i + 1).padStart(2, \"0\")}.png`);\n      const rendered = await renderCompareVariant(variant, {","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/cli/src/commands/compare.ts#L281-L317","documentation":"The outer catch in renderCompareVariant(): it wraps EVERY failure inside the per-variant render pipeline — bundleToSingleHtml, serveStaticProjectHtml, openSettledCompositionPage (Puppeteer/Chrome), seekCompositionTimeline, and page.screenshot — into one Error tagged with the variant label, displayPath, and the normalized inner message. It is a catch-all, so the inner cause is what matters.","triggerScenarios":"Composition HTML is malformed so bundling fails; Chrome/Puppeteer is missing or crashes; the static project server cannot bind its port; seekCompositionTimeline fails (no GSAP timeline / no seek adapter registered on window.__timelines); the screenshot path is unwritable; --at is beyond the timeline duration.","commonSituations":"Chrome not installed in CI; a variant composition missing data-* attributes or shipping broken JS; --out pointing at a read-only or non-existent directory; a very short timeline combined with a large --at.","solutions":["Read the normalized inner message in the thrown error — it names the actual root cause","Run `hyperframes lint` and `hyperframes check` on the failing variant composition","Verify Chrome is installed and the --out directory is writable","Lower --at to a value within the composition duration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await renderCompareVariant(variant, opts);\n} catch (err) {\n  // The wrapper already includes label + displayPath + inner cause.\n  // Inspect err.message for the normalized root cause before deciding.\n  console.error(`compare variant ${variant.label} failed:`, (err as Error).message);\n  throw err;\n}","preventionTips":["Run `hyperframes lint` and `hyperframes check` on each variant composition before comparing","Ensure Chrome/Puppeteer is installed and the --out directory is writable","Keep --at within each composition's timeline duration"],"tags":["render","puppeteer","compare","bundling","catch-all"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}