abhigyanpatwari/GitNexus · error · GitNexusRcError
${source} must list at least one string.
Error message
${source} must list at least one string. What it means
A string-array config key (currently only `fetchWrappers`) was set to an empty array `[]`. Because each non-string/empty/invalid entry throws earlier in the loop, this branch is reached only when the array is empty — GitNexus treats declaring the key as intent to add wrappers, so an empty list is rejected as a likely leftover or mistake.
Source
Thrown at gitnexus/src/cli/analyze-config.ts:280
}
const trimmed = item.trim();
if (!trimmed) {
throw new GitNexusRcError(`${source} entries must not be empty.`);
}
assertNoHiddenChars(trimmed, source);
// Values may be interpolated into a RegExp downstream. Restrict to
// identifier / member-access shapes so a config value can never smuggle
// regex metacharacters into a consumer.
if (!/^[A-Za-z_$][A-Za-z0-9_$.]*$/.test(trimmed)) {
throw new GitNexusRcError(
`${source} entry "${trimmed}" must be an identifier or member name ` +
`(letters, digits, _, $, . — e.g. "client.get").`,
);
}
names.push(trimmed);
}
if (names.length === 0) {
throw new GitNexusRcError(`${source} must list at least one string.`);
}
// De-duplicate and cap to a sane bound so a pathological config cannot
// blow up the consumer scan's alternation.
return Array.from(new Set(names)).slice(0, 100);
}
case 'numeric-string': {
// Mirror Commander's contract: these options reach the existing CLI
// validation as strings. Accept a JSON number or a string; normalize to a
// string and let the downstream per-flag validation enforce ranges so the
// error messages stay in one place.
if (typeof value === 'number') {
if (!Number.isFinite(value)) {
throw new GitNexusRcError(`${source} must be a finite number.`);
}
return String(value);
}
if (typeof value === 'string') {
const trimmed = value.trim();View on GitHub (pinned to d540b00184)
Solutions
- Remove the `fetchWrappers` key entirely if you have no wrappers to declare.
- Add at least one valid wrapper name (see error 40 for the identifier rules).
Example fix
// before "fetchWrappers": [] // after (remove the key) — or — "fetchWrappers": ["client.get"]
Defensive patterns
Strategy: validation
Validate before calling
// Drop the key instead of committing an empty array
if (Array.isArray(cfg.fetchWrappers) && cfg.fetchWrappers.length === 0) {
delete cfg.fetchWrappers;
} Prevention
- Omit the fetchWrappers key when there are no wrappers rather than setting [].
- Treat an empty array as 'remove the key' in any config generator.
When it happens
Trigger: Setting { "fetchWrappers": [] } in `.gitnexusrc`.
Common situations: Removing all custom wrappers but leaving the key behind; a templated/generated config that renders an empty array when no wrappers apply; cleanup that blanked the list instead of deleting the key.
Related errors
- ${source} entry "${trimmed}" must be an identifier or member
- ${source} must be a finite number.
- ${source} must be a number or numeric string.
- ${source} must be true/false or a non-negative integer (node
- ${source} must be a boolean or a non-negative integer (node
AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12).
Data as JSON: /api/errors/dd39ec63ee032c15.
Report an issue: GitHub.