yamadashy/repomix · error · RepomixError

Unsupported output style: ${config.output.style}

Error message

Unsupported output style: ${config.output.style}

What it means

generateOutput dispatches on config.output.style; xml, json, markdown and plain are handled, anything else falls into the default branch and throws. This is the top-level guard against unknown output styles in the merged configuration.

Source

Thrown at src/core/output/outputGenerate.ts:308

    gitDiffResult,
    gitLogResult,
    filePathsByRoot,
    emptyDirPaths,
  );
  const renderContext = createRenderContext(outputGeneratorContext);

  switch (config.output.style) {
    case 'xml':
      return config.output.parsableStyle
        ? deps.generateParsableXmlOutput(renderContext)
        : deps.generateHandlebarOutput(config, renderContext, sortedProcessedFiles);
    case 'json':
      return deps.generateParsableJsonOutput(renderContext);
    case 'markdown':
    case 'plain':
      return deps.generateHandlebarOutput(config, renderContext, sortedProcessedFiles);
    default:
      throw new RepomixError(`Unsupported output style: ${config.output.style}`);
  }
};

export const buildOutputGeneratorContext = async (
  rootDirs: string[],
  config: RepomixConfigMerged,
  allFilePaths: string[],
  processedFiles: ProcessedFile[],
  gitDiffResult: GitDiffResult | undefined = undefined,
  gitLogResult: GitLogResult | undefined = undefined,
  filePathsByRoot?: FilesByRoot[],
  emptyDirPaths?: string[],
  deps = {
    listDirectories,
    listFiles,
    searchFiles,
  },
): Promise<OutputGeneratorContext> => {

View on GitHub (pinned to f465ad9093)

Solutions

  1. Set output.style to one of: xml, json, markdown, plain.
  2. Fix case sensitivity — use lowercase values in config/CLI.
  3. Validate your config against the repomix config schema before running.
  4. If migrating, check the changelog for renamed style values.

Example fix

// before
{ "output": { "style": "md" } }
// after
{ "output": { "style": "markdown" } }
Defensive patterns

Strategy: validation

Validate before calling

const VALID_STYLES = ['xml', 'json', 'markdown', 'plain'] as const;
if (!VALID_STYLES.includes(config.output.style as never)) {
  throw new Error(`output.style must be one of ${VALID_STYLES.join(', ')}; got '${config.output.style}'`);
}

Type guard

const isValidStyle = (s: string): s is 'xml' | 'json' | 'markdown' | 'plain' =>
  ['xml', 'json', 'markdown', 'plain'].includes(s);

Try / catch

try {
  const output = await generateOutput(config, renderContext);
} catch (e) {
  if (e instanceof RepomixError && e.message.startsWith('Unsupported output style')) {
    console.error(`Fix config.output.style (got '${config.output.style}'). Valid: xml, json, markdown, plain.`);
  }
}

Prevention

When it happens

Trigger: generateOutput(config, ...) runs with config.output.style set to an unhandled value such as 'txt', 'yaml', an empty string, or a misspelled option loaded from repomix.config.json or CLI flags.

Common situations: Typo in the config file ('Markdown' with wrong case, 'md'); older configs carrying a style value removed in a newer repomix version; programmatic use building config objects by hand.

Related errors


AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29). Data as JSON: /api/errors/3767760e13fcfafd. Report an issue: GitHub.