gatsbyjs/gatsby · error

code block or inline code language not specified in markdown

Error message

code block or inline code 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' with inline code also present (noInlineHighlight false), meaning no language was specified in markdown. 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 to the code fence info string, e.g. ```js
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/075ec40c58d668c6. Report an issue: GitHub.