{"record":{"id":"3807f04adefd9d83","repo":"moeru-ai/airi","slug":"missing-value-for-settle-ms","errorCode":null,"errorMessage":"Missing value for --settle-ms.","messagePattern":"Missing value for --settle-ms\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts","lineNumber":71,"sourceCode":"    filePath: derivedFilePath,\n    format: 'avif',\n  }\n}\n\nif (!['png', 'avif'].includes(requestedFormat)) {\n  throw new Error(`Unsupported capture format \"${requestedFormat}\". Expected \"png\" or \"avif\".`)\n}\n\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","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts#L53-L89","documentation":"The capture script reads --settle-ms from argv[settleMsFlagIndex + 1] (capture.ts:19,25) and applies it as the wait time before screenshotting. This error fires when the flag exists but the following argv slot is undefined or empty, so the settle delay (default 500 ms) cannot be parsed. It is a strict usage check: naming the flag without a value is treated as a caller mistake, not as 'use the default'.","triggerScenarios":"Passing --settle-ms as the final CLI token (`... --settle-ms`), or an empty string as its value (`--settle-ms \"\"`). Any wrapper that builds the command from a variable that happens to be empty also triggers it.","commonSituations":"Automated capture pipelines that append `--settle-ms \"$SETTLE\"` when SETTLE is unset, or copy-pasted commands where the numeric value was accidentally deleted.","solutions":["Provide a non-negative millisecond value: `--settle-ms 1500`","Drop the flag to keep the 500 ms default","In scripts, guard the variable: only append the flag when the value is non-empty (`[ -n \"$SETTLE\" ] && echo \"--settle-ms $SETTLE\"`)"],"exampleFix":"// before\npnpm capture --settle-ms\n// after\npnpm capture --settle-ms 1500","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--settle-ms')\nif (i >= 0 && !argv[i + 1])\n  throw new Error('Missing value for --settle-ms.') // or fall back to the 500 ms default","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only append --settle-ms when the variable is set and non-empty","Keep the flag adjacent to its numeric value in command templates","Remember the unit is milliseconds when computing the value"],"tags":["cli","argv","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-23T08:17:48.524Z"}