yamadashy/repomix · warning
Failed to compress ${rawFile.path}, using uncompressed conte
Error message
Failed to compress ${rawFile.path}, using uncompressed content: ${message} What it means
When compression is enabled, processContent attempts to compress each file's content (e.g. via tree-sitter based code compression). If compression throws or returns undefined, the file is NOT failed — instead repomix logs a warning naming the file and the underlying message and falls back to the uncompressed content. This is a logged warning, not a thrown error.
Source
Thrown at src/core/file/fileProcessContent.ts:51
// normally precomputed in the main thread and threaded through; fall back to
// resolving it here when it is not supplied. This honors per-file
// output.patterns overrides and the global output.compress setting.
const effectiveLevel = level ?? resolveFileLevel(rawFile.path, config.output);
if (effectiveLevel === 'compress') {
// Compression is best-effort. parseFile returns undefined when it cannot
// compress a file (unsupported language, parse failure, or a tree-sitter
// WASM abort on a pathological file); in that case we keep the uncompressed
// content so a single file's failure never aborts the entire pack. The
// catch is a safety net: parseFile is designed not to throw.
try {
const parsedContent = await parseFile(processedContent, rawFile.path, config);
if (parsedContent === undefined) {
logger.trace(`Could not compress ${rawFile.path}. Using uncompressed content.`);
}
processedContent = parsedContent ?? processedContent;
} catch (error: unknown) {
const message = error instanceof Error ? error.message : String(error);
logger.warn(`Failed to compress ${rawFile.path}, using uncompressed content: ${message}`);
}
}
const processEndAt = process.hrtime.bigint();
logger.trace(`Processed file: ${rawFile.path}. Took: ${(Number(processEndAt - processStartAt) / 1e6).toFixed(2)}ms`);
return processedContent;
};
View on GitHub (pinned to f465ad9093)
Solutions
- No action needed — the file is included uncompressed; this is expected fallback behavior
- Exclude problematic files via the `ignore` config or narrower `include` globs
- Read the appended underlying message to identify the unsupported language/syntax
- Update repomix if a newer version adds the parser for that file type
Example fix
// before (repomix.config.json)
{ "include": ["**/*"], "output": { "compress": true } }
// after
{ "include": ["src/**/*.{ts,js}"], "output": { "compress": true }, "ignore": { "patterns": ["generated/**"] } } Defensive patterns
Strategy: fallback
Validate before calling
const COMPRESSIBLE = /\.(ts|tsx|js|jsx|py|go|rs|java|c|cpp|rb|php)$/;
if (compress && !COMPRESSIBLE.test(file.path)) {
// expect fallback warning; exclude file or accept uncompressed
} Try / catch
try {
processed = processContent(rawFile, { compress: true });
} catch (e) {
if (String(e.message).startsWith('Failed to compress')) {
processed = rawFile.content; // accept the built-in fallback
} else throw e;
} Prevention
- Treat this warning as informational — output stays complete
- Exclude generated/minified/unparseable files via ignore patterns
- Keep include globs tight to source files repomix can parse
- Update repomix to gain parsers for more languages
When it happens
Trigger: Compressing a file whose language is not supported by the compression parsers (unknown extension), malformed/unparseable source code that the parser chokes on, or a parser initialization failure for a particular file type.
Common situations: Repositories containing generated files, minified JS, or exotic languages not covered by tree-sitter grammars; files with syntax errors; lock files or data files included by broad include globs.
Related errors
- Failed to compress ${filePath}, using uncompressed content:
- wl-copy failed (${msg}); falling back.
- File processor for "${rawFile.path}" failed, using original
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/4130d61f75d65497.
Report an issue: GitHub.