mui/material-ui · error · Error

docs-infra: The description "${description}" should end with

Error message

docs-infra: The description "${description}" should end with a "." or "!", those are sentences.

What it means

prepareMarkdown enforces that the `description:` frontmatter header reads as a sentence: it must end with '.' or '!'. This keeps meta descriptions consistent and grammatical across the docs site. Descriptions ending in other punctuation, emojis, or nothing are rejected at build time.

Source

Thrown at packages-internal/markdown/prepareMarkdown.mjs:130

      }

      if (description == null || description === '') {
        throw new Error(`docs-infra: Missing description in the page: ${location}\n`);
      }

      if (description.length > 160) {
        throw new Error(
          [
            `docs-infra: The description "${description}" is too long (${description.length} characters).`,
            'It needs to have fewer than 170 characters—ideally less than 160. For more details, see:',
            'https://ahrefs.com/blog/meta-description/#4-be-concise',
            '',
          ].join('\n'),
        );
      }

      if (description.slice(-1) !== '.' && description.slice(-1) !== '!') {
        throw new Error(
          `docs-infra: The description "${description}" should end with a "." or "!", those are sentences.`,
        );
      }

      const contents = getContents(markdown);

      if (headers.components.length > 0 && headers.productId !== 'base-ui') {
        contents.push(`
## API

See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.

${headers.components
  .map((component) => {
    const componentPkgMap = componentPackageMapping[headers.productId];
    const componentPkg = componentPkgMap ? componentPkgMap[component] : null;
    return `- [\`<${component} />\`](${resolveComponentApiUrl(
      headers.productId,

View on GitHub (pinned to bdc96df2cb)

Solutions

  1. Rewrite the description as a complete sentence ending in '.' or '!'.
  2. Re-run `pnpm docs:build` to confirm.

Example fix

---
description: A page about buttons:
---
// after
---
description: A page about buttons.
---
Defensive patterns

Strategy: validation

Validate before calling

function endsAsSentence(description) {
  return /[.!]$/.test(description);
}
if (!endsAsSentence(headers.description)) throw new Error('Description must end with . or !');

Prevention

When it happens

Trigger: Writing a `description:` header that ends with a character other than '.' or '!' (e.g. ends with a colon, comma, or no terminal punctuation).

Common situations: Description truncated mid-edit; description ending in a trailing quote or parenthesis; copied fragment that was not a full sentence.

Related errors


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