facebook/docusaurus · error · Error

Duplicate blog post authors were found in blog post path=${b

Error message

Duplicate blog post authors were found in blog post path=${blogSourceRelative} front matter:
- ${duplicateAuthors.map(authorToString).join('\n- ')}

What it means

Thrown by assertBlogPostAuthorsUnique when a single blog post lists the same predefined author key more than once in its `authors` front matter. Only authors with a `key` (resolved from the authors map) are checked; the first occurrence is kept and any extras are reported as duplicates.

Source

Thrown at packages/docusaurus-plugin-content-blog/src/authorsProblems.ts:65

export function reportDuplicateAuthors({
  authors,
  blogSourceRelative,
}: {
  authors: Author[];
  blogSourceRelative: string;
}): void {
  const duplicateAuthors = _(authors)
    // for now we only check for predefined authors duplicates
    .filter((author) => !!author.key)
    .groupBy((author) => author.key)
    .pickBy((authorsByKey) => authorsByKey.length > 1)
    // We only keep the "test" of all the duplicate groups
    // The first author of a group is not really a duplicate...
    .flatMap(([, ...rest]) => rest)
    .value();

  if (duplicateAuthors.length > 0) {
    throw new Error(logger.interpolate`Duplicate blog post authors were found in blog post path=${blogSourceRelative} front matter:
- ${duplicateAuthors.map(authorToString).join('\n- ')}`);
  }
}

function authorToString(author: Author) {
  return JSON.stringify(author);
}

View on GitHub (pinned to 3f483e80e3)

Solutions

  1. Open the blog source file printed in the message.
  2. Remove the duplicate author entry (keep one occurrence per key).
  3. If you intended co-authors with the same name, give the second one a distinct key or remove its key.

Example fix

---
# before
authors: [jane, jane]
---
---
# after
authors: [jane]
---
Defensive patterns

Strategy: validation

Validate before calling

const keys = frontMatter.authors.filter((a: any) => typeof a === 'string' || a?.key).map((a: any) => typeof a === 'string' ? a : a.key);
const dupes = keys.filter((k: string, i: number, arr: string[]) => arr.indexOf(k) !== i);
if (dupes.length) throw new Error(`Duplicate author keys: ${dupes}`);

Prevention

When it happens

Trigger: Front matter `authors: [jane, jane]` or `authors: [jane, name: Jane Doe]` where the second also resolves to key `jane`. Triggered during blog source processing per post.

Common situations: Copy-paste errors when listing authors, mixing keyed references and inline duplicates of the same person, or YAML merge unexpectedly duplicating entries.

Related errors


AI-assisted analysis of facebook/docusaurus@3f483e80e3 (2026-08-12). Data as JSON: /api/errors/f5bb92b2afc75d05. Report an issue: GitHub.