{"record":{"id":"fb778e48a675de05","repo":"yamadashy/repomix","slug":"unsupported-config-file-format-filepath","errorCode":null,"errorMessage":"Unsupported config file format: ${filePath}","messagePattern":"Unsupported config file format: (.+?)","errorType":"exception","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/config/configLoad.ts","lineNumber":200,"sourceCode":"        const defaultExport =\n          imported && typeof imported === 'object' && 'default' in imported\n            ? (imported as { default: unknown }).default\n            : undefined;\n        config = defaultExport && typeof defaultExport === 'object' ? defaultExport : imported;\n        break;\n      }\n\n      case 'json5':\n      case 'jsonc':\n      case 'json': {\n        // Use JSON5 for JSON/JSON5/JSONC files\n        const fileContent = await fs.readFile(filePath, 'utf-8');\n        config = JSON5.parse(fileContent);\n        break;\n      }\n\n      default:\n        throw new RepomixError(`Unsupported config file format: ${filePath}`);\n    }\n\n    return v.parse(repomixConfigFileSchema, config);\n  } catch (error) {\n    rethrowValidationErrorIfSchemaError(error, 'Invalid config schema');\n    if (error instanceof SyntaxError) {\n      throw new RepomixError(`Invalid syntax in config file ${filePath}: ${error.message}`);\n    }\n    if (error instanceof Error) {\n      throw new RepomixError(`Error loading config from ${filePath}: ${error.message}`);\n    }\n    throw new RepomixError(`Error loading config from ${filePath}`);\n  }\n};\n\nexport const mergeConfigs = (\n  cwd: string,\n  fileConfig: RepomixConfigFile,","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/config/configLoad.ts#L182-L218","documentation":"loadAndValidateConfig dispatches on the config file's extension. Executable extensions (.ts/.mts/.cts/.js/.mjs/.cjs) go through jiti; .json5/.jsonc/.json are parsed with JSON5; anything else hits the default case, which throws this RepomixError. In practice this means --config was pointed at a file whose extension repomix does not recognize (getFileExtension returns '' or an unsupported value), so repomix cannot know how to parse it.","triggerScenarios":"Passing `--config file.yaml`, `--config config.toml`, `--config repomix.conf`, or any path lacking one of the supported extensions (.ts .mts .cts .js .mjs .cjs .json5 .jsonc .json) to repomix. The getFileExtension regex matches exactly those endings; e.g. a `.JSON` (uppercase) or `.yml` file lands in the default case.","commonSituations":"Porting a config from another tool (TOML/YAML); uppercase or double extensions like config.json.bak; creating a config without an extension; copying a snippet into `repomix.config` with no suffix.","solutions":["Rename the config to a supported extension: repomix.config.json (or .json5/.jsonc/.js/.ts etc.).","Convert YAML/TOML content to JSON (e.g. `yq -o=json config.yaml > repomix.config.json`).","Remove extra suffixes (.bak, .template) from the filename before passing it via --config.","Ensure the extension case is lowercase (`.json`, not `.JSON`), since matching is case-sensitive."],"exampleFix":"# before\nrepomix --config repomix.yaml\n\n# after\nyq -o=json repomix.yaml > repomix.config.json\nrepomix --config repomix.config.json","handlingStrategy":"validation","validationCode":"const SUPPORTED = /\\.(ts|mts|cts|js|mjs|cjs|json5|jsonc|json)$/;\nif (!SUPPORTED.test(configPath)) {\n  throw new Error(`${configPath}: unsupported extension; use repomix.config.{json,json5,jsonc,js,ts,...}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runPack({ config: argConfigPath });\n} catch (e) {\n  if (e instanceof RepomixError && e.message.startsWith('Unsupported config file format')) {\n    console.error(`Rename/convert the config to a supported format: ${e.message}`);\n  } else throw e;\n}","preventionTips":["Name configs repomix.config.json (or .json5/.jsonc/.js/.ts) with lowercase extensions.","Convert YAML/TOML configs to JSON before use.","Strip backup suffixes like .bak/.template from the filename.","Keep extension-case checks in wrappers (lowercase .json, not .JSON)."],"tags":["config","cli","unsupported-format","file-extension"],"backgroundTag":"unsupported-config-format","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}