{"record":{"id":"3767760e13fcfafd","repo":"yamadashy/repomix","slug":"unsupported-output-style-config-output-style","errorCode":null,"errorMessage":"Unsupported output style: ${config.output.style}","messagePattern":"Unsupported output style: (.+?)","errorType":"validation","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/core/output/outputGenerate.ts","lineNumber":308,"sourceCode":"    gitDiffResult,\n    gitLogResult,\n    filePathsByRoot,\n    emptyDirPaths,\n  );\n  const renderContext = createRenderContext(outputGeneratorContext);\n\n  switch (config.output.style) {\n    case 'xml':\n      return config.output.parsableStyle\n        ? deps.generateParsableXmlOutput(renderContext)\n        : deps.generateHandlebarOutput(config, renderContext, sortedProcessedFiles);\n    case 'json':\n      return deps.generateParsableJsonOutput(renderContext);\n    case 'markdown':\n    case 'plain':\n      return deps.generateHandlebarOutput(config, renderContext, sortedProcessedFiles);\n    default:\n      throw new RepomixError(`Unsupported output style: ${config.output.style}`);\n  }\n};\n\nexport const buildOutputGeneratorContext = async (\n  rootDirs: string[],\n  config: RepomixConfigMerged,\n  allFilePaths: string[],\n  processedFiles: ProcessedFile[],\n  gitDiffResult: GitDiffResult | undefined = undefined,\n  gitLogResult: GitLogResult | undefined = undefined,\n  filePathsByRoot?: FilesByRoot[],\n  emptyDirPaths?: string[],\n  deps = {\n    listDirectories,\n    listFiles,\n    searchFiles,\n  },\n): Promise<OutputGeneratorContext> => {","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/core/output/outputGenerate.ts#L290-L326","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set output.style to one of: xml, json, markdown, plain.","Fix case sensitivity — use lowercase values in config/CLI.","Validate your config against the repomix config schema before running.","If migrating, check the changelog for renamed style values."],"exampleFix":"// before\n{ \"output\": { \"style\": \"md\" } }\n// after\n{ \"output\": { \"style\": \"markdown\" } }","handlingStrategy":"validation","validationCode":"const VALID_STYLES = ['xml', 'json', 'markdown', 'plain'] as const;\nif (!VALID_STYLES.includes(config.output.style as never)) {\n  throw new Error(`output.style must be one of ${VALID_STYLES.join(', ')}; got '${config.output.style}'`);\n}","typeGuard":"const isValidStyle = (s: string): s is 'xml' | 'json' | 'markdown' | 'plain' =>\n  ['xml', 'json', 'markdown', 'plain'].includes(s);","tryCatchPattern":"try {\n  const output = await generateOutput(config, renderContext);\n} catch (e) {\n  if (e instanceof RepomixError && e.message.startsWith('Unsupported output style')) {\n    console.error(`Fix config.output.style (got '${config.output.style}'). Valid: xml, json, markdown, plain.`);\n  }\n}","preventionTips":["Validate config against the repomix JSON schema at startup.","Use lowercase style values; the switch is case-sensitive.","Keep only the four documented values in config files and wrappers.","After upgrading repomix, re-check for renamed/removed style values."],"tags":["output","configuration","cli"],"backgroundTag":"unsupported-output-style","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}