moeru-ai/airi · error · Error
Missing value for --avif-max-width.
Error message
Missing value for --avif-max-width.
What it means
The capture script reads --avif-max-width from argv[avifMaxWidthFlagIndex + 1] (capture.ts:20,26); the value feeds avifTransformer, which downscales PNG artifacts wider than this before re-encoding to AVIF (capture.ts:38-41). This error fires when the flag is present but the next argv slot is undefined or empty, so the width (default 1200) cannot be read. Like the sibling checks, it is a fail-fast guard against half-specified CLI input.
Source
Thrown at packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts:75
if (!['png', 'avif'].includes(requestedFormat)) {
throw new Error(`Unsupported capture format "${requestedFormat}". Expected "png" or "avif".`)
}
if (!routePath?.startsWith('/')) {
throw new Error(`Unsupported route path "${routePath}". Route paths must start with "/".`)
}
if (outputDirFlagIndex >= 0 && !argv[outputDirFlagIndex + 1]) {
throw new Error('Missing value for --output-dir.')
}
if (settleMsFlagIndex >= 0 && !argv[settleMsFlagIndex + 1]) {
throw new Error('Missing value for --settle-ms.')
}
if (avifMaxWidthFlagIndex >= 0 && !argv[avifMaxWidthFlagIndex + 1]) {
throw new Error('Missing value for --avif-max-width.')
}
if (avifQualityFlagIndex >= 0 && !argv[avifQualityFlagIndex + 1]) {
throw new Error('Missing value for --avif-quality.')
}
if (avifSpeedFlagIndex >= 0 && !argv[avifSpeedFlagIndex + 1]) {
throw new Error('Missing value for --avif-speed.')
}
if (!Number.isFinite(settleMs) || settleMs < 0) {
throw new Error(`Unsupported settle delay "${argv[settleMsFlagIndex + 1] ?? settleMs}". Expected a number >= 0.`)
}
if (!Number.isFinite(avifMaxWidth) || avifMaxWidth < 1) {
throw new Error(`Unsupported AVIF max width "${argv[avifMaxWidthFlagIndex + 1] ?? avifMaxWidth}". Expected a number >= 1.`)
}
View on GitHub (pinned to 677329427f)
Solutions
- Supply a positive pixel width: `--avif-max-width 1200`
- Omit the flag to keep the default 1200
- Only append AVIF flags when `--format avif` is actually requested, from a validated variable
Example fix
// before pnpm capture --format avif --avif-max-width // after pnpm capture --format avif --avif-max-width 1200
Defensive patterns
Strategy: validation
Validate before calling
const i = argv.indexOf('--avif-max-width')
if (i >= 0 && !argv[i + 1])
throw new Error('Missing value for --avif-max-width.')
// only forward AVIF flags when --format avif is requested Prevention
- Group all --avif-* flags behind a single `format === 'avif'` condition
- Pass pixel counts, not words or percentages
- Validate numeric flags in the wrapper script before exec
When it happens
Trigger: Passing --avif-max-width as the last token of the command, or with an empty-string value; typically only used together with `--format avif`.
Common situations: AVIF capture jobs in CI where the width variable is conditionally set, or command lines assembled by concatenating optional fragments that end with a dangling flag.
Related errors
- Missing value for --avif-quality.
- Missing value for --avif-speed.
- Unsupported AVIF max width "${argv[avifMaxWidthFlagIndex + 1
- Unsupported AVIF quality "${argv[avifQualityFlagIndex + 1] ?
- Unsupported AVIF speed "${argv[avifSpeedFlagIndex + 1] ?? av
AI-assisted analysis of moeru-ai/airi@677329427f (2026-08-18).
Data as JSON: /api/errors/224e74930c4cb8e1.
Report an issue: GitHub.