{"record":{"id":"4130d61f75d65497","repo":"yamadashy/repomix","slug":"failed-to-compress-rawfile-path-using-uncompre","errorCode":null,"errorMessage":"Failed to compress ${rawFile.path}, using uncompressed content: ${message}","messagePattern":"Failed to compress (.+?), using uncompressed content: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/core/file/fileProcessContent.ts","lineNumber":51,"sourceCode":"  // normally precomputed in the main thread and threaded through; fall back to\n  // resolving it here when it is not supplied. This honors per-file\n  // output.patterns overrides and the global output.compress setting.\n  const effectiveLevel = level ?? resolveFileLevel(rawFile.path, config.output);\n  if (effectiveLevel === 'compress') {\n    // Compression is best-effort. parseFile returns undefined when it cannot\n    // compress a file (unsupported language, parse failure, or a tree-sitter\n    // WASM abort on a pathological file); in that case we keep the uncompressed\n    // content so a single file's failure never aborts the entire pack. The\n    // catch is a safety net: parseFile is designed not to throw.\n    try {\n      const parsedContent = await parseFile(processedContent, rawFile.path, config);\n      if (parsedContent === undefined) {\n        logger.trace(`Could not compress ${rawFile.path}. Using uncompressed content.`);\n      }\n      processedContent = parsedContent ?? processedContent;\n    } catch (error: unknown) {\n      const message = error instanceof Error ? error.message : String(error);\n      logger.warn(`Failed to compress ${rawFile.path}, using uncompressed content: ${message}`);\n    }\n  }\n\n  const processEndAt = process.hrtime.bigint();\n  logger.trace(`Processed file: ${rawFile.path}. Took: ${(Number(processEndAt - processStartAt) / 1e6).toFixed(2)}ms`);\n\n  return processedContent;\n};\n","sourceCodeStart":33,"sourceCodeEnd":60,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/core/file/fileProcessContent.ts#L33-L60","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (repomix.config.json)\n{ \"include\": [\"**/*\"], \"output\": { \"compress\": true } }\n// after\n{ \"include\": [\"src/**/*.{ts,js}\"], \"output\": { \"compress\": true }, \"ignore\": { \"patterns\": [\"generated/**\"] } }","handlingStrategy":"fallback","validationCode":"const COMPRESSIBLE = /\\.(ts|tsx|js|jsx|py|go|rs|java|c|cpp|rb|php)$/;\nif (compress && !COMPRESSIBLE.test(file.path)) {\n  // expect fallback warning; exclude file or accept uncompressed\n}","typeGuard":null,"tryCatchPattern":"try {\n  processed = processContent(rawFile, { compress: true });\n} catch (e) {\n  if (String(e.message).startsWith('Failed to compress')) {\n    processed = rawFile.content; // accept the built-in fallback\n  } else throw e;\n}","preventionTips":["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"],"tags":["compression","fallback","parsing"],"backgroundTag":"compression-fallback-warning","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}