{"record":{"id":"684e20a9048864f6","repo":"moeru-ai/airi","slug":"missing-value-for-avif-speed","errorCode":null,"errorMessage":"Missing value for --avif-speed.","messagePattern":"Missing value for --avif-speed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts","lineNumber":83,"sourceCode":"\nif (outputDirFlagIndex >= 0 && !argv[outputDirFlagIndex + 1]) {\n  throw new Error('Missing value for --output-dir.')\n}\n\nif (settleMsFlagIndex >= 0 && !argv[settleMsFlagIndex + 1]) {\n  throw new Error('Missing value for --settle-ms.')\n}\n\nif (avifMaxWidthFlagIndex >= 0 && !argv[avifMaxWidthFlagIndex + 1]) {\n  throw new Error('Missing value for --avif-max-width.')\n}\n\nif (avifQualityFlagIndex >= 0 && !argv[avifQualityFlagIndex + 1]) {\n  throw new Error('Missing value for --avif-quality.')\n}\n\nif (avifSpeedFlagIndex >= 0 && !argv[avifSpeedFlagIndex + 1]) {\n  throw new Error('Missing value for --avif-speed.')\n}\n\nif (!Number.isFinite(settleMs) || settleMs < 0) {\n  throw new Error(`Unsupported settle delay \"${argv[settleMsFlagIndex + 1] ?? settleMs}\". Expected a number >= 0.`)\n}\n\nif (!Number.isFinite(avifMaxWidth) || avifMaxWidth < 1) {\n  throw new Error(`Unsupported AVIF max width \"${argv[avifMaxWidthFlagIndex + 1] ?? avifMaxWidth}\". Expected a number >= 1.`)\n}\n\nif (!Number.isFinite(avifQuality) || avifQuality < 0 || avifQuality > 100) {\n  throw new Error(`Unsupported AVIF quality \"${argv[avifQualityFlagIndex + 1] ?? avifQuality}\". Expected a number between 0 and 100.`)\n}\n\nif (!Number.isFinite(avifSpeed) || avifSpeed < 1 || avifSpeed > 10) {\n  throw new Error(`Unsupported AVIF speed \"${argv[avifSpeedFlagIndex + 1] ?? avifSpeed}\". Expected a number between 1 and 10.`)\n}\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts#L65-L101","documentation":"The capture script reads --avif-speed from argv[avifSpeedFlagIndex + 1] (capture.ts:22,28) and passes it into Transformer.avif({ speed }) (capture.ts:43-46), where 1 is slowest/best compression and 10 is fastest. This error fires when the flag is present but the next argv slot is undefined or empty, so the speed value (default 6) cannot be read; the 1-10 range is enforced separately at capture.ts:99.","triggerScenarios":"Passing --avif-speed as the last token of an AVIF capture command, or with an empty string value.","commonSituations":"Speed/quality tuning scripts where the speed variable is left unset, or command templates whose optional flag list ends with a dangling --avif-speed.","solutions":["Provide a speed between 1 and 10: `--avif-speed 6`","Omit the flag to keep the default 6","Build AVIF flags from a validated options object so empty values never reach argv"],"exampleFix":"// before\npnpm capture --format avif --avif-speed\n// after\npnpm capture --format avif --avif-speed 6","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--avif-speed')\nif (i >= 0 && !argv[i + 1])\n  throw new Error('Missing value for --avif-speed.')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the encoder speed scale is 1-10, not 0-100","Map qualitative presets (fast/balanced/best) to numbers in the caller","Lint CI commands for dangling value-flags before execution"],"tags":["cli","argv","avif","vishot","capture"],"backgroundTag":"missing-cli-argument-value","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}