fix(cli): improve error message for zero-duration composition renders#129
Conversation
832d9ce to
16defad
Compare
e0326b9 to
5fa757d
Compare
ce3dd2a to
a415c64
Compare
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bb3bcd2 to
1704c30
Compare
a415c64 to
fbd77c3
Compare
fbd77c3 to
ab1a5a1
Compare
1704c30 to
898d7c4
Compare
miguel-heygen
left a comment
There was a problem hiding this comment.
Two issues:
1. message.includes("duration") is too broad
The "__hf not ready" check alone covers the zero-duration failure path (the engine error at frameCapture.ts:251 already contains that substring). The || message.includes("duration") branch will false-positive on unrelated errors — e.g. FFmpeg failures containing "Invalid duration", ffprobe output parsing, audio mixer issues — all of which would incorrectly get the "Composition may have zero duration" hint instead of the Docker hint.
Recommend removing the || message.includes("duration") branch entirely, or narrowing to something very specific like message.includes("duration > 0").
2. Same error can occur in renderLocal path
The renderLocal catch block (line ~298) still shows a generic hint. The same __hf not ready error originates from frameCapture.ts which is used by both render paths. Consider extracting the hint-selection into a helper and applying it to both paths:
function renderHintForError(error: unknown, fallback: string): string {
const message = error instanceof Error ? error.message : String(error);
if (message.includes("__hf not ready")) {
return "Composition may have zero duration. Add data-duration to the root element or ensure the GSAP timeline has tweens.";
}
return fallback;
}When a composition had zero duration (empty GSAP timeline, no data-duration), Docker render hung for 45s then showed the misleading hint "Check Docker is running" even though Docker was fine. Now detects the __hf-not-ready error and suggests adding data-duration or GSAP tweens instead. Reproducer: # Create composition with empty timeline and no data-duration npx hyperframes render --docker --output out.mp4 # Was: "Check Docker is running: docker info" # Now: "Composition may have zero duration. Add data-duration..."
898d7c4 to
5430f9a
Compare
ab1a5a1 to
17f11f7
Compare
miguel-heygen
left a comment
There was a problem hiding this comment.
Addressed both points: (1) removed broad includes("duration"), now only matches "__hf not ready". (2) Extracted renderHintForError() helper and applied to both renderDocker and renderLocal catch blocks.
|
Consolidated into fix/render-improvements. |

PR Stack
Summary
data-duration), Docker render hung for 45s then showed the misleading hint "Check Docker is running" even though Docker was fine__hf not readytimeout error and provides a context-aware hint about zero duration insteadReproducer
Stack
8/8 — Depends on #128. Last PR in the stack.
🤖 Generated with Claude Code