moeru-ai/airi · error · Error
Missing value for --settle-ms.
Error message
Missing value for --settle-ms.
What it means
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'.
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"`)
Example fix
// before pnpm capture --settle-ms // after pnpm capture --settle-ms 1500
Defensive patterns
Strategy: validation
Validate before calling
const i = argv.indexOf('--settle-ms')
if (i >= 0 && !argv[i + 1])
throw new Error('Missing value for --settle-ms.') // or fall back to the 500 ms default Prevention
- 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
When it happens
Trigger: 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.
Common situations: Automated capture pipelines that append `--settle-ms "$SETTLE"` when SETTLE is unset, or copy-pasted commands where the numeric value was accidentally deleted.
Related errors
- Missing value for --avif-max-width.
- Missing value for --avif-quality.
- Missing value for --avif-speed.
- Missing value for --output-dir.
- Unsupported AVIF max width
AI-assisted analysis of moeru-ai/airi@677329427f (2026-08-18).
Data as JSON: /api/errors/3807f04adefd9d83.
Report an issue: GitHub.
Appendix: source
Thrown at packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts:71
filePath: derivedFilePath,
format: 'avif',
}
}
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.`)
}
View on GitHub (pinned to 677329427f)