moeru-ai/airi · error · Error
Missing value for --avif-quality.
Error message
Missing value for --avif-quality.
What it means
The capture script reads --avif-quality from argv[avifQualityFlagIndex + 1] (capture.ts:21,27) and passes it straight into Transformer.avif({ quality }) from @napi-rs/image (capture.ts:43-46). This error fires when the flag is present but the following argv slot is undefined or empty, so the quality value (default 35) cannot be read. It only checks presence here; the 0-100 range is validated separately at capture.ts:95.
Source
Thrown at packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts:79
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.`)
}
if (!Number.isFinite(avifQuality) || avifQuality < 0 || avifQuality > 100) {
throw new Error(`Unsupported AVIF quality "${argv[avifQualityFlagIndex + 1] ?? avifQuality}". Expected a number between 0 and 100.`)
}
View on GitHub (pinned to 677329427f)
Solutions
- Provide a quality between 0 and 100: `--avif-quality 35`
- Omit the flag to keep the default 35
- Validate the variable before appending it to the command line
Example fix
// before pnpm capture --format avif --avif-quality // after pnpm capture --format avif --avif-quality 35
Defensive patterns
Strategy: validation
Validate before calling
const i = argv.indexOf('--avif-quality')
if (i >= 0 && !argv[i + 1])
throw new Error('Missing value for --avif-quality.') Prevention
- Treat quality as an integer 0-100 in pipeline configuration
- Reject empty values at config-load time rather than at capture time
- Keep AVIF options in one object so they are appended together or not at all
When it happens
Trigger: Passing --avif-quality as the final CLI token or with an empty-string value, usually in an AVIF capture invocation (`--format avif --avif-quality`).
Common situations: Quality knobs exposed through CI matrices where one axis is empty, or hand-edited commands where the number was removed but the flag stayed.
Related errors
- Missing value for --avif-max-width.
- 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/bb775788d647da34.
Report an issue: GitHub.