NousResearch/hermes-agent · error

Theme has no "colors" map — not a VS Code color theme.

Error message

Theme has no "colors" map — not a VS Code color theme.

What it means

Thrown by convertVscodeColorTheme when the parsed VS Code theme JSON has no usable 'colors' object. This converter maps VS Code editor colors onto a Hermes desktop palette; the colors map (editor.background, foreground, token colors, etc.) is the core input, so a theme that only ships tokenScopes or UI definitions without colors is rejected as not a color theme.

Source

Thrown at apps/desktop/src/themes/vscode.ts:209

  keys: string[],
  backdrop: string
): { key: string; value: string } | null => {
  for (const key of keys) {
    const value = normalizeHex(typeof colors[key] === 'string' ? (colors[key] as string) : null, backdrop)

    if (value) {
      return { key, value }
    }
  }

  return null
}

export function convertVscodeColorTheme(raw: VscodeColorTheme, opts: ConvertOptions = {}): ConvertResult {
  const colors = raw.colors && typeof raw.colors === 'object' ? (raw.colors as Record<string, unknown>) : null

  if (!colors) {
    throw new Error('Theme has no "colors" map — not a VS Code color theme.')
  }

  const derived: string[] = []

  // Background first: it's the backdrop every other token flattens alpha over.
  const backgroundHit = pick(
    colors,
    ['editor.background', 'editorPane.background', 'editorGroup.background'],
    '#000000'
  )

  const dark = isDarkType(raw, backgroundHit?.value ?? '#1e1e1e')
  const background = backgroundHit?.value ?? (dark ? '#1e1e1e' : '#ffffff')

  if (!backgroundHit) {
    derived.push('editor.background')
  }

View on GitHub (pinned to c896c09c42)

Solutions

  1. Open the JSON and verify it contains a "colors": { ... } object with editor.background/editor.foreground entries.
  2. Pick the color theme file listed in the extension's package.json contributes.themes[].path, not adjacent token files.
  3. If the extension legitimately has no colors, it cannot be converted — use a different extension.
Defensive patterns

Strategy: type-guard

Validate before calling

function hasColorsMap(raw: object): boolean {
  return Boolean(raw.colors) && typeof raw.colors === 'object'
}

Type guard

function isColorThemeRaw(raw: unknown): raw is { colors: Record<string, unknown> } {
  return typeof raw === 'object' && raw !== null
    && typeof (raw as { colors?: unknown }).colors === 'object'
    && (raw as { colors?: unknown }).colors !== null
}

Try / catch

try {
  convertVscodeColorTheme(raw, { label })
} catch (e) {
  if (e instanceof Error && e.message.includes('no "colors" map'))
    skipFile('Not a VS Code color theme (token-only)')
  else throw e
}

Prevention

When it happens

Trigger: Passing a theme JSON whose top level lacks 'colors' or has colors as a non-object (string/number), e.g. a pure TextMate token-scope theme or a language definition file.

Common situations: Selecting the wrong file from an extension's themes/ directory, or installing an extension whose theme contribution points at a scopes-only JSON.

Related errors


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/56f8764878dfc9ea. Report an issue: GitHub.