{"record":{"id":"a5ec3ebd481f9289","repo":"gatsbyjs/gatsby","slug":"unable-to-find-prism-language-difflanguage-fo","errorCode":null,"errorMessage":"unable to find prism language '${diffLanguage}' for highlighting. applying generic code block","messagePattern":"unable to find prism language '(.+?)' for highlighting\\. applying generic code block","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-remark-prismjs/src/highlight-code.js","lineNumber":55,"sourceCode":"      const lang = language.toLowerCase()\n      if (!unsupportedLanguages.has(lang)) {\n        console.warn(message, `applying generic code block`)\n        unsupportedLanguages.add(lang)\n      }\n      return escapeHTML(code, additionalEscapeCharacters)\n    }\n  }\n\n  // (Try to) load diffLanguage on demand.\n  if (diffLanguage && !Prism.languages[diffLanguage]) {\n    try {\n      loadPrismLanguage(diffLanguage)\n    } catch (e) {\n      const message = `unable to find prism language '${diffLanguage}' for highlighting.`\n\n      const lang = diffLanguage.toLowerCase()\n      if (!unsupportedLanguages.has(lang)) {\n        console.warn(message, `applying generic code block`)\n        unsupportedLanguages.add(lang)\n      }\n      // Ignore diffLanguage when it does not exist.\n      diffLanguage = null\n    }\n  }\n\n  const grammar = Prism.languages[language]\n  const highlighted = Prism.highlight(\n    code,\n    grammar,\n    diffLanguage ? `${language}-${diffLanguage}` : language\n  )\n  const codeSplits = handleDirectives(highlighted, lineNumbersHighlight)\n\n  let finalCode = ``\n  const lastIdx = codeSplits.length - 1 // Don't add back the new line character after highlighted lines\n  // as they need to be display: block and full-width.","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-remark-prismjs/src/highlight-code.js#L37-L73","documentation":"Prism fallback warning during code highlighting: the block's diff language (the language inside a diff fence) failed to load via loadPrismLanguage. The diffLanguage is added to the unsupported set (warn once), then the code is escaped and rendered as a generic code block without diff or target-language highlighting.","triggerScenarios":"Thrown at packages/gatsby-remark-prismjs/src/highlight-code.js:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the diff language identifier or remove it from the fence info string"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}