abhigyanpatwari/GitNexus · error · GitNexusRcError
${source} must not be empty.
Error message
${source} must not be empty. What it means
Thrown by normalizeValue() in the 'string' case when the value is a string but trims to empty. Repo names and embedding URLs flow into generated content and downstream config, so an empty value would produce broken output (e.g. an empty **${name}** in AGENTS.md).
Source
Thrown at gitnexus/src/cli/analyze-config.ts:234
}
return value;
case 'boolean-negate':
if (typeof value !== 'boolean') {
throw new GitNexusRcError(`${source} must be a boolean (true/false).`);
}
return !value;
case 'branch':
if (typeof value !== 'string') {
throw new GitNexusRcError(`${source} must be a string branch name.`);
}
return validateBranchName(value, source);
case 'string': {
if (typeof value !== 'string') {
throw new GitNexusRcError(`${source} must be a string.`);
}
const trimmed = value.trim();
if (!trimmed) {
throw new GitNexusRcError(`${source} must not be empty.`);
}
assertNoHiddenChars(trimmed, source);
// `name` flows into the generated AGENTS.md/CLAUDE.md as `**${name}**` and
// inside `gitnexus://repo/${name}/…` code spans, so a Markdown-significant
// character would break those spans or inject emphasis/links/HTML into
// agent-instruction content (#1996 tri-review P1). `_` is intentionally
// allowed (legitimate in repo names; intraword `_` is not emphasis).
// embeddingDevice (the other `string`-kind option) only ever holds a
// fixed device token, so this guard never rejects a valid value there.
if (/[`*[\]<>]/.test(trimmed)) {
throw new GitNexusRcError(
`${source} must not contain Markdown-significant characters (\` * [ ] < >).`,
);
}
return trimmed;
}
case 'string-array': {
// Generic shared validator — `source` already names the config key, soView on GitHub (pinned to d540b00184)
Solutions
- Provide a non-empty, non-whitespace value.
- Remove the key entirely to accept the default behavior.
- Trim surrounding whitespace in the source value before committing.
Example fix
// before
{ "name": " " }
// after
{ "name": "my-repo" } Defensive patterns
Strategy: validation
Validate before calling
function assertNonEmptyString(value: unknown, key: string): void {
if (typeof value !== 'string' || value.trim() === '') {
throw new Error(`${key} must not be empty`);
}
} Type guard
function isNonEmptyConfigString(value: unknown): value is string {
return typeof value === 'string' && value.trim().length > 0;
} Prevention
- Remove the config key rather than leaving it as an empty string.
- Fill template placeholders before committing .gitnexusrc.
- Trim values at the source rather than relying on whitespace-only entries.
When it happens
Trigger: Setting "name": "", "name": " ", "embeddingBaseUrl": " ", or "embeddingModel": "" in .gitnexusrc.
Common situations: A config template with an empty placeholder; clearing a value by setting it to empty rather than removing the key; a whitespace-only value from a copy-paste.
Related errors
- Unsupported provider: ${(config as any).provider}
- Invalid backend URL: must be a well-formed http:// or https:
- Backend URL must use http:// or https:// (got ${parsed.proto
- ${source}: value contains control or hidden/bidirectional ch
- ${source}: branch name must not be empty.
AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12).
Data as JSON: /api/errors/b5a9eaca56197148.
Report an issue: GitHub.