{"record":{"id":"bb775788d647da34","repo":"moeru-ai/airi","slug":"missing-value-for-avif-quality","errorCode":null,"errorMessage":"Missing value for --avif-quality.","messagePattern":"Missing value for --avif-quality\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts","lineNumber":79,"sourceCode":"\nif (!routePath?.startsWith('/')) {\n  throw new Error(`Unsupported route path \"${routePath}\". Route paths must start with \"/\".`)\n}\n\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","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts#L61-L97","documentation":"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.","triggerScenarios":"Passing --avif-quality as the final CLI token or with an empty-string value, usually in an AVIF capture invocation (`--format avif --avif-quality`).","commonSituations":"Quality knobs exposed through CI matrices where one axis is empty, or hand-edited commands where the number was removed but the flag stayed.","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"],"exampleFix":"// before\npnpm capture --format avif --avif-quality\n// after\npnpm capture --format avif --avif-quality 35","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--avif-quality')\nif (i >= 0 && !argv[i + 1])\n  throw new Error('Missing value for --avif-quality.')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"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"}