remix-run/remix · error · UsageError
--config requires a value.
Error message
--config requires a value.
What it means
The global CLI option parser requires a value after a space-separated --config flag. The next argv entry is missing, empty, or looks like another flag (starts with '-'), so the config path is rejected.
Source
Thrown at packages/cli/src/lib/cli.ts:167
let noColor = false
for (let index = 0; index < argv.length; index++) {
let arg = argv[index]!
if (arg === '--') {
filteredArgv.push(...argv.slice(index))
break
}
if (arg === '--no-color') {
noColor = true
continue
}
if (arg === '--config') {
let value = argv[index + 1]
if (value == null || value.length === 0 || value.startsWith('-')) {
throw missingOptionValue('--config')
}
configPath = value
index++
continue
}
if (arg.startsWith('--config=')) {
let value = arg.slice('--config='.length)
if (value.length === 0) {
throw missingOptionValue('--config')
}
configPath = value
continue
}
filteredArgv.push(arg)
}
View on GitHub (pinned to 9696913134)
Solutions
- Provide a value: remix --config remix.config.json dev
- Use the equals form: --config=remix.config.json
- Check shell scripts for unquoted/empty variables passed as the config path
Example fix
# before $ remix --config # missing value # after $ remix --config remix.config.json dev
Defensive patterns
Strategy: validation
Validate before calling
function configFlagHasValue(argv: string[]): boolean {
let i = argv.indexOf('--config')
if (i === -1) return true
let v = argv[i + 1]
return v != null && v.length > 0 && !v.startsWith('-')
} Try / catch
try {
runCli(argv)
} catch (error) {
if (/--config requires a value/.test(error.message)) printUsage()
else throw error
} Prevention
- Use --config=path form in scripts to make the pairing explicit
- Guard empty variables: ${CONFIG:-remix.config.json} in shell scripts
- Add a wrapper that validates required-value flags before exec
When it happens
Trigger: Running remix --config with nothing after it, or followed immediately by another flag, e.g. 'remix --config --verbose' or a trailing 'remix dev --config' at end of argv.
Common situations: Shell scripts or CI pipelines concatenating flags where the config path variable is empty; users assuming --config is a boolean flag; copy-paste errors from docs.
Related errors
- throw new AssertionError({ message, actual, expected, operat
- expect(received).toThrow() requires a function (got ${typeof
- expected promise to resolve, but it rejected with: ${stringi
- expected promise to reject, but it resolved with: ${stringif
- throw new TypeError(message)
AI-assisted analysis of remix-run/remix@9696913134 (2026-08-27).
Data as JSON: /api/errors/650bc6d98cbcfe5f.
Report an issue: GitHub.