nexu-io/open-design · error · Error
Vela video only supports durations of 5 or 10 seconds; recei
Error message
Vela video only supports durations of 5 or 10 seconds; received ${input.length} What it means
Thrown when input.length is provided but is not in VELA_VIDEO_DURATIONS = new Set([5, 10]). The set contains numbers, not strings — a string '5' will fail the .has() check because Set uses strict equality. This check is skipped entirely when input.length is null/undefined (defaults to 5s downstream).
Source
Thrown at apps/daemon/src/media/vela.ts:425
} · ${requestedQuality ?? 'model default quality'} · ${bytes.length} bytes`,
suggestedExt: extensionForImageMime(mime),
};
} finally {
await rm(tempDir, { recursive: true, force: true });
}
}
export async function renderVelaVideo(
input: VelaVideoRenderInput,
runCommand: VelaCommandRunner = runVelaCommand,
): Promise<VelaRenderResult> {
assertInputImageCount(input.imageRefs);
const ratio = input.aspect ?? '16:9';
if (!VELA_VIDEO_RATIOS.has(ratio)) {
throw new Error(`Vela video only supports aspect ratios 16:9, 9:16, or 1:1; received ${ratio}`);
}
if (input.length != null && !VELA_VIDEO_DURATIONS.has(input.length)) {
throw new Error(`Vela video only supports durations of 5 or 10 seconds; received ${input.length}`);
}
const wireModel = wireModelForVela(input.model, input.wireModel);
const tempDir = await mkdtemp(path.join(os.tmpdir(), 'open-design-vela-video-'));
const outputPath = path.join(tempDir, 'result.mp4');
const startedAt = Date.now();
const pollIntervalMs = positiveIntegerFromEnv(
'OD_VELA_VIDEO_POLL_INTERVAL_MS',
DEFAULT_VELA_VIDEO_POLL_INTERVAL_MS,
);
const totalTimeoutMs = positiveIntegerFromEnv(
'OD_VELA_VIDEO_TIMEOUT_MS',
DEFAULT_VELA_VIDEO_TOTAL_TIMEOUT_MS,
);
const pollCommandTimeoutMs = positiveIntegerFromEnv(
'OD_VELA_VIDEO_POLL_COMMAND_TIMEOUT_MS',
DEFAULT_VELA_VIDEO_POLL_COMMAND_TIMEOUT_MS,
);View on GitHub (pinned to 5be4028344)
Solutions
- Set input.length to the number 5 or the number 10
- Omit input.length to default to 5 seconds at render time
- Coerce string inputs with Number(input.length) and verify the result is 5 or 10 before calling
Example fix
// before — string '5' fails Set.has because Set uses ===
renderVelaVideo({ length: '5', imageRefs: refs, ... });
// after — number 5 passes the check
renderVelaVideo({ length: 5, imageRefs: refs, ... }); Defensive patterns
Strategy: validation
Validate before calling
const VELA_VIDEO_DURATIONS = new Set([5, 10]);
function assertValidVelaDuration(length) {
if (length != null && !VELA_VIDEO_DURATIONS.has(length)) {
throw new Error(`Unsupported duration: ${length}. Use 5 or 10 (number).`);
}
return length;
} Type guard
function isVelaVideoDuration(value: unknown): value is 5 | 10 {
return (value === 5 || value === 10);
} Prevention
- Always pass input.length as a number, never a string — Set.has uses strict equality
- If receiving duration from JSON, coerce with Number() and validate before passing
- Omit input.length entirely if the default 5s is acceptable
When it happens
Trigger: Calling renderVelaVideo with input.length set to any value other than the number 5 or the number 10 — e.g. input.length = 15, input.length = '5' (string), input.length = 0, input.length = 3.
Common situations: Passing duration as a string from a JSON payload without coercing to number; UI offering durations the backend doesn't support; caller assuming the value is in seconds and passing arbitrary integers.
Related errors
- Vela video only supports aspect ratios 16:9, 9:16, or 1:1; r
- authorized pull receipt has invalid ${key}
- authorized pull response must be an object
- Vela media accepts at most ${VELA_MAX_INPUT_IMAGES} input im
- Vela model ${wireModel} does not publish a quality capabilit
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/b31d1b1be6550b9f.
Report an issue: GitHub.