yamadashy/repomix · warning

Failed to compress ${filePath}, using uncompressed content:

Error message

Failed to compress ${filePath}, using uncompressed content: ${message}

What it means

parseFile logs this warning when the Tree-sitter based compression step throws for a file; the function returns undefined so the caller packs the raw uncompressed content. If the failure came from a corrupted worker-local parser, later files on the same worker also fall back, as noted in the source comment.

Source

Thrown at src/core/treeSitter/parseFile.ts:122

    const mergedChunks = mergeAdjacentChunks(filteredChunks);

    return mergedChunks
      .map((chunk) => chunk.content)
      .join(`\n${CHUNK_SEPARATOR}\n`)
      .trim();
  } catch (error: unknown) {
    // Any failure here (language preparation, parsing, or a WASM runtime abort)
    // degrades to uncompressed content instead of aborting the whole pack.
    //
    // Note on hard WASM aborts (e.g. "table index is out of bounds"): such an
    // abort can leave this worker's shared tree-sitter runtime degraded. The
    // parser singleton is reused for the worker's lifetime, so later files routed
    // to the same worker may also fall back to uncompressed output. This is
    // bounded per worker and surfaced by the warning below. Recovering the
    // runtime would require recycling the worker, which is out of scope here; the
    // init-failure path is already retried by getLanguageParserSingleton.
    const message = error instanceof Error ? error.message : String(error);
    logger.warn(`Failed to compress ${filePath}, using uncompressed content: ${message}`);
    return undefined;
  } finally {
    tree?.delete();
  }
};

const getLanguageParserSingleton = async () => {
  if (!languageParserSingleton) {
    // Assign only after init() succeeds. Otherwise a failed init would leave an
    // uninitialized parser cached for the rest of the worker's lifetime, so
    // every subsequent file would throw "not initialized" and silently lose
    // compression. Keeping the singleton null lets the next call retry init.
    const parser = new LanguageParser();
    await parser.init();
    languageParserSingleton = parser;
  }
  return languageParserSingleton;
};

View on GitHub (pinned to f465ad9093)

Solutions

  1. Accept the fallback — output is uncompressed but correct; silence by disabling compression (remove compress option) if the warning is noisy.
  2. Update repomix (and its tree-sitter language packages) to get grammar/runtime fixes.
  3. Identify the file from the log and exclude it if its compression is not important.
  4. If many files warn, restart the run — worker parser corruption is bounded per worker and a fresh process recovers it.

Example fix

// before: compress everything, warns on exotic syntax
"output": { "compression": true }
// after: keep raw content for the problematic file
"ignore": { "customPatterns": { "**/weird.min.js": true } }
Defensive patterns

Strategy: fallback

Validate before calling

// confirm the grammar handles the file before enabling compression
const supported = ['.ts', '.tsx', '.js', '.py', ...];
if (!supported.some(ext => filePath.endsWith(ext))) disableCompressionFor(filePath);

Type guard

const isCompressible = (ext, langs) => langs.some(l => l.extensions?.includes(ext));

Try / catch

const compressed = await parseFile(filePath, content, config).catch(() => undefined);
const out = compressed ?? content; // fall back to raw content

Prevention

When it happens

Trigger: Tree-sitter parse or compress throws: WASM runtime corruption in a worker, unsupported/failed language init, malformed syntax crashing the parser, or a Tree-sitter node API error.

Common situations: Files with syntax exotic enough to break the grammar; a worker's parser singleton corrupted after an earlier init failure; language grammar/WASM version mismatches.

Related errors


AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29). Data as JSON: /api/errors/e02c174d1c574e1d. Report an issue: GitHub.