gatsbyjs/gatsby · error

code block language not specified in markdown. applying gene

Error message

code block language not specified in markdown. applying generic code block

What it means

Prism fallback warning during code highlighting: the code block's language resolved to 'text' in a no-inline-highlight context, i.e. no language was specified on the fence. Prism cannot apply syntax highlighting, so the code is escaped and rendered as a generic code block instead.

Source

Thrown at packages/gatsby-remark-prismjs/src/highlight-code.js:39

      loadPrismLanguage(language)
    } catch (e) {
      // Language wasn't loaded so let's bail.
      let message = null
      switch (language) {
        case `none`:
          return code // Don't escape if set to none.
        case `text`:
          message = noInlineHighlight
            ? `code block language not specified in markdown.`
            : `code block or inline code language not specified in markdown.`
          break
        default:
          message = `unable to find prism language '${language}' for highlighting.`
      }

      const lang = language.toLowerCase()
      if (!unsupportedLanguages.has(lang)) {
        console.warn(message, `applying generic code block`)
        unsupportedLanguages.add(lang)
      }
      return escapeHTML(code, additionalEscapeCharacters)
    }
  }

  // (Try to) load diffLanguage on demand.
  if (diffLanguage && !Prism.languages[diffLanguage]) {
    try {
      loadPrismLanguage(diffLanguage)
    } catch (e) {
      const message = `unable to find prism language '${diffLanguage}' for highlighting.`

      const lang = diffLanguage.toLowerCase()
      if (!unsupportedLanguages.has(lang)) {
        console.warn(message, `applying generic code block`)
        unsupportedLanguages.add(lang)
      }

View on GitHub (pinned to e85d62f177)

Solutions

  1. Add a language identifier to the opening code fence
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/gatsby-remark-prismjs/src/highlight-code.js:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/7ab437466dba7967. Report an issue: GitHub.