yamadashy/repomix · error · RepomixError

Language configuration not found for: ${name}

Error message

Language configuration not found for: ${name}

What it means

LanguageParser.prepareLang looks up the tree-sitter language configuration via getLanguageConfigByName before loading the wasm grammar. If the requested supported-lang name has no registered config, it throws this RepomixError. It indicates an internal mismatch between requested language and the config registry rather than a user typo (type-checked by SupportedLang).

Source

Thrown at src/core/treeSitter/languageParser.ts:29

  lang: SupportedLang;
  parser: Parser;
  query: Query;
  strategy: ParseStrategy;
}

export class LanguageParser {
  private loadedResources: Map<SupportedLang, LanguageResources> = new Map();
  private initialized = false;

  private getFileExtension(filePath: string): string {
    return path.extname(filePath).toLowerCase().slice(1);
  }

  private async prepareLang(name: SupportedLang): Promise<LanguageResources> {
    try {
      const config = getLanguageConfigByName(name);
      if (!config) {
        throw new RepomixError(`Language configuration not found for: ${name}`);
      }

      const lang = await loadLanguage(name);
      const parser = new Parser();
      parser.setLanguage(lang);
      const query = new Query(lang, config.query);
      // Create strategy instance lazily when first needed
      // NOTE: Strategy instances are cached per language in this.loadedResources
      // and shared across all files of the same language. This is safe because
      // all current strategies are stateless and only use the parameters passed
      // to their parseCapture method.
      const strategy = config.createStrategy();

      const resources: LanguageResources = {
        lang: name,
        parser,
        query,
        strategy,

View on GitHub (pinned to f465ad9093)

Solutions

  1. Add a config entry for the language in the language config registry (src/core/treeSitter/queries or language config file)
  2. Verify the language name string matches the key used in the config map exactly
  3. If you are a library user, report/upgrade — this should be unreachable via typed APIs

Example fix

// before
export const languageConfigs = { typescript: tsConfig, python: pyConfig };
// after
export const languageConfigs = { typescript: tsConfig, python: pyConfig, rust: rustConfig };
Defensive patterns

Strategy: validation

Validate before calling

import { languageConfigs } from './languageConfigs.js'; // registry
const isConfiguredLang = (name: string): name is SupportedLang =>
  Object.prototype.hasOwnProperty.call(languageConfigs, name);
if (!isConfiguredLang(name)) throw new Error(`no tree-sitter config for ${name}`);

Try / catch

try {
  const resources = await parser.getResources(lang);
} catch (err) {
  if (err instanceof RepomixError && err.message.startsWith('Language configuration not found')) {
    console.error(`${lang} lacks a registered config; add one or skip this language.`);
  } else throw err;
}

Prevention

When it happens

Trigger: Calling getResources/prepareLang with a SupportedLang name that is missing from the language-config registry, typically after adding a new language to SupportedLang without adding its config entry.

Common situations: Developers extending Repomix with a new language forget to register its config (query file, extensions); version mismatch where SupportedLang union was updated but config table was not.

Related errors


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