{"record":{"id":"7e37456fe65e027d","repo":"yamadashy/repomix","slug":"language-configuration-not-found-for-name","errorCode":null,"errorMessage":"Language configuration not found for: ${name}","messagePattern":"Language configuration not found for: (.+?)","errorType":"exception","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/core/treeSitter/languageParser.ts","lineNumber":29,"sourceCode":"  lang: SupportedLang;\n  parser: Parser;\n  query: Query;\n  strategy: ParseStrategy;\n}\n\nexport class LanguageParser {\n  private loadedResources: Map<SupportedLang, LanguageResources> = new Map();\n  private initialized = false;\n\n  private getFileExtension(filePath: string): string {\n    return path.extname(filePath).toLowerCase().slice(1);\n  }\n\n  private async prepareLang(name: SupportedLang): Promise<LanguageResources> {\n    try {\n      const config = getLanguageConfigByName(name);\n      if (!config) {\n        throw new RepomixError(`Language configuration not found for: ${name}`);\n      }\n\n      const lang = await loadLanguage(name);\n      const parser = new Parser();\n      parser.setLanguage(lang);\n      const query = new Query(lang, config.query);\n      // Create strategy instance lazily when first needed\n      // NOTE: Strategy instances are cached per language in this.loadedResources\n      // and shared across all files of the same language. This is safe because\n      // all current strategies are stateless and only use the parameters passed\n      // to their parseCapture method.\n      const strategy = config.createStrategy();\n\n      const resources: LanguageResources = {\n        lang: name,\n        parser,\n        query,\n        strategy,","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/core/treeSitter/languageParser.ts#L11-L47","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add a config entry for the language in the language config registry (src/core/treeSitter/queries or language config file)","Verify the language name string matches the key used in the config map exactly","If you are a library user, report/upgrade — this should be unreachable via typed APIs"],"exampleFix":"// before\nexport const languageConfigs = { typescript: tsConfig, python: pyConfig };\n// after\nexport const languageConfigs = { typescript: tsConfig, python: pyConfig, rust: rustConfig };","handlingStrategy":"validation","validationCode":"import { languageConfigs } from './languageConfigs.js'; // registry\nconst isConfiguredLang = (name: string): name is SupportedLang =>\n  Object.prototype.hasOwnProperty.call(languageConfigs, name);\nif (!isConfiguredLang(name)) throw new Error(`no tree-sitter config for ${name}`);","typeGuard":null,"tryCatchPattern":"try {\n  const resources = await parser.getResources(lang);\n} catch (err) {\n  if (err instanceof RepomixError && err.message.startsWith('Language configuration not found')) {\n    console.error(`${lang} lacks a registered config; add one or skip this language.`);\n  } else throw err;\n}","preventionTips":["When adding a language, update SupportedLang and the config registry together (and tests)","Add a unit test asserting every SupportedLang has a config entry","Keep language name strings centralized to avoid key typos"],"tags":["tree-sitter","configuration","internal"],"backgroundTag":"missing-language-config","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}