yamadashy/repomix · error
Unsupported file format: ${fileExtension}. Supported formats
Error message
Unsupported file format: ${fileExtension}. Supported formats: ${supportedExtensions.join(', ')} What it means
resolveOutputFilePath validates that a file input has an extension matching one of repomix's supported output formats (derived from the default output file paths: xml, md, json, txt). If the extension is not recognized, it throws because it cannot infer the packed-output format from the file.
Source
Thrown at src/mcp/tools/attachPackedOutputTool.ts:81
await fs.access(outputFilePath);
const format = getFormatFromFileName(fileName);
return { filePath: outputFilePath, format };
} catch {
// File doesn't exist, continue to next
}
}
throw new Error(
`No repomix output file found in directory: ${inputPath}. Looking for: ${possibleFiles.join(', ')}`,
);
}
// If it's a file, check if it's a supported format
const supportedExtensions = Object.values(defaultFilePathMap).map((file) => path.extname(file));
const fileExtension = path.extname(inputPath).toLowerCase();
if (!supportedExtensions.includes(fileExtension)) {
throw new Error(
`Unsupported file format: ${fileExtension}. Supported formats: ${supportedExtensions.join(', ')}`,
);
}
const format = getFormatFromExtension(fileExtension);
return { filePath: inputPath, format };
} catch (error) {
if (error instanceof Error && error.message.includes('ENOENT')) {
throw new Error(`File or directory not found for path: ${inputPath}`, { cause: error });
}
throw error;
}
}
/**
* Get format from file name
*/
function getFormatFromFileName(fileName: string): string {View on GitHub (pinned to f465ad9093)
Solutions
- Rename the file to use a supported extension (.xml, .md, .json, .txt)
- Regenerate the output with the format you want: `repomix --style xml` producing repomix-output.xml
- Pass a supported-format file path directly to the tool
Example fix
// before
await attachPackedOutput({ path: './out/repomix-output.yaml' });
// after
await $`mv out/repomix-output.yaml out/repomix-output.xml`; // ensure real xml content
await attachPackedOutput({ path: './out/repomix-output.xml' }); Defensive patterns
Strategy: validation
Validate before calling
const ok = /\.(xml|md|json|txt)$/i.test(inputPath);
if (!ok) throw new Error(`Rename ${inputPath} to a .xml/.md/.json/.txt repomix output`); Try / catch
try {
await attachPackedOutput({ path: inputPath });
} catch (e) {
if (String(e.message).startsWith('Unsupported file format')) {
// rename/copy to a supported extension and retry
} else throw e;
} Prevention
- Keep repomix outputs at their default filenames
- Never rename outputs to non-standard extensions
- Store format in the filename extension when scripting
When it happens
Trigger: Calling the attach tool with a file whose extension is not .xml/.md/.json/.txt (e.g. .yaml, .log, .out, or a file with no extension), or an unusual case variant handled by path.extname but not in the map.
Common situations: Renaming repomix-output.xml to something like repomix-output.bak or packing to a custom filename with a non-standard extension; on some systems a file saved without extension after an editor session.
Related errors
- Invalid regular expression pattern: ${pattern}. ${error inst
- Unsupported config file format: ${filePath}
- No valid file paths found in stdin input.
- Invalid branch or ref name. Name must not start with '-': ${
- Invalid owner/repo in repo URL
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/9854222d1ed004e5.
Report an issue: GitHub.