{"record":{"id":"1c590ae389366a7b","repo":"facebook/docusaurus","slug":"can-t-reference-blog-post-authors-by-a-key-such-a","errorCode":null,"errorMessage":"Can't reference blog post authors by a key (such as '${key}') because no authors map file could be loaded.\nPlease double-check your blog plugin config (in particular 'authorsMapPath'), ensure the file exists at the configured path, is not empty, and is valid!","messagePattern":"Can't reference blog post authors by a key \\(such as '(.+?)'\\) because no authors map file could be loaded\\.\nPlease double-check your blog plugin config \\(in particular 'authorsMapPath'\\), ensure the file exists at the configured path, is not empty, and is valid!","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-blog/src/authors.ts","lineNumber":125,"sourceCode":"        // support keys, otherwise, a typo in a key would fall back to\n        // becoming a name and may end up unnoticed\n        return {key: authorInput};\n      }\n      return {\n        ...authorInput,\n        socials: normalizeSocials(authorInput.socials ?? {}),\n      };\n    }\n\n    return Array.isArray(frontMatter.authors)\n      ? frontMatter.authors.map(normalizeAuthor)\n      : [normalizeAuthor(frontMatter.authors)];\n  }\n\n  function getAuthorsMapAuthor(key: string | undefined): Author | undefined {\n    if (key) {\n      if (!authorsMap || Object.keys(authorsMap).length === 0) {\n        throw new Error(`Can't reference blog post authors by a key (such as '${key}') because no authors map file could be loaded.\nPlease double-check your blog plugin config (in particular 'authorsMapPath'), ensure the file exists at the configured path, is not empty, and is valid!`);\n      }\n      const author = authorsMap[key];\n      if (!author) {\n        throw Error(`Blog author with key \"${key}\" not found in the authors map file.\nValid author keys are:\n${Object.keys(authorsMap)\n  .map((validKey) => `- ${validKey}`)\n  .join('\\n')}`);\n      }\n      return author;\n    }\n    return undefined;\n  }\n\n  function toAuthor(frontMatterAuthor: BlogPostFrontMatterAuthor): Author {\n    const author = {\n      // Author def from authorsMap can be locally overridden by front matter","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-blog/src/authors.ts#L107-L143","documentation":"Thrown by getAuthorsMapAuthor when a blog post references an author by key (e.g. `authors: [sebastien]`) but no authors map could be loaded — authorsMap is null or empty. The message points you to the 'authorsMapPath' blog plugin option and requires the file to exist, be non-empty, and be valid.","triggerScenarios":"Front matter uses an author key string while authorsMapPath is unset, points to a missing file, or the file failed to parse. Triggered during blog source processing when normalizing authors.","commonSituations":"You removed or renamed authors.yml, set the wrong path in blog plugin config (authorsMapPath), or the YAML has a syntax error so the map resolves empty. Migration from inline authors to keyed authors without creating the map file.","solutions":["Create an authors map file (default authors.yml) at the blog content root with at least one keyed author.","Verify the blog plugin option authorsMapPath points to that file (absolute or relative to content path).","Validate the YAML parses and contains the keys referenced in front matter.","If you did not mean to use keys, switch front matter to inline author objects."],"exampleFix":"// docusaurus.config.js — before\nblog: { path: 'blog' }\n// after\nblog: { path: 'blog', authorsMapPath: 'authors.yml' }\n// blog/authors.yml\nsebastien:\n  name: Sebastien Lorber\n  url: https://sebastienlorber.com","handlingStrategy":"validation","validationCode":"import fs from 'fs-extra';\nimport yaml from 'yaml';\nconst exists = await fs.pathExists(authorsMapPath);\nconst parsed = exists ? yaml.parse(await fs.readFile(authorsMapPath, 'utf8')) : null;\nif (!parsed || Object.keys(parsed).length === 0) {\n  throw new Error(`Authors map missing or empty at ${authorsMapPath}`);\n}","typeGuard":"const hasAuthorsMap = (m: unknown): m is Record<string, unknown> =>\n  !!m && typeof m === 'object' && Object.keys(m as object).length > 0;","tryCatchPattern":null,"preventionTips":["Always commit authors.yml alongside posts that reference author keys.","Verify authorsMapPath in blog plugin options points to the right file."],"tags":["blog","authors","config","frontmatter"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}