mui/material-ui · error · Error

docs-infra: Unsupported language: "sh" in:\n\n```sh\n${code}

Error message

docs-infra: Unsupported language: "sh" in:\n\n```sh\n${code}\n```\n\nUse "bash" instead.\n

What it means

The docs syntax highlighter (prism.mjs) rejects the `sh` fenced code-block language alias and asks for `bash` instead. The project standardised on `bash` to keep grammar/tokenisation consistent, so `sh` is treated as a configuration error and fails the build with a snippet of the offending block.

Source

Thrown at packages-internal/markdown/prism.mjs:24

import 'prismjs/components/prism-json.js';
import 'prismjs/components/prism-jsx.js';
import 'prismjs/components/prism-markup.js';
import 'prismjs/components/prism-yaml.js';
import 'prismjs/components/prism-tsx.js';

function highlight(code, language) {
  let prismLanguage;
  switch (language) {
    case 'ts':
      prismLanguage = prism.languages.tsx;
      break;

    case 'js':
      prismLanguage = prism.languages.jsx;
      break;

    case 'sh':
      throw new Error(
        [
          `docs-infra: Unsupported language: "sh" in:`,
          '',
          '```sh',
          code,
          '```',
          '',
          'Use "bash" instead.',
          '',
        ].join('\n'),
      );

    case 'diff':
      prismLanguage = { ...prism.languages.diff };
      // original `/^[-<].*$/m` matches lines starting with `<` which matches
      // <SomeComponent />
      // we will only use `-` as the deleted marker
      prismLanguage.deleted = /^[-].*$/m;

View on GitHub (pinned to bdc96df2cb)

Solutions

  1. Change the fence from ```sh to ```bash in the offending markdown file (the error includes the code snippet to locate it).
  2. Re-run `pnpm docs:build` to confirm.
  3. Configure your editor/docs linting to flag `sh` fences.

Example fix

```sh
npm install
```
// after
```bash
npm install
```
Defensive patterns

Strategy: validation

Validate before calling

function validateFenceLanguage(lang) {
  if (lang === 'sh') throw new Error('Use "bash" instead of "sh" for fenced code blocks');
}
// run over each fenced block extracted from markdown

Prevention

When it happens

Trigger: Authoring a markdown docs page with a ```sh fenced code block; the build runs the highlighter and throws.

Common situations: Copy-pasting shell snippets from external sources that default to ```sh; muscle memory from other doc systems that accept sh.

Related errors


AI-assisted analysis of mui/material-ui@bdc96df2cb (2026-08-12). Data as JSON: /api/errors/7c61fbb9e078aa8c. Report an issue: GitHub.