{"record":{"id":"98c11d46ddbbe065","repo":"facebook/docusaurus","slug":"no-tags-file-relativefilepath-could-be-found","errorCode":null,"errorMessage":"No tags file '${relativeFilePath}' could be found in any of those directories:\n- ${getContentPathList(contentPaths).join('\\n- ')}","messagePattern":"No tags file '(.+?)' could be found in any of those directories:\n- (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/docusaurus-utils-validation/src/tagsFile.ts","lineNumber":106,"sourceCode":"  if (tags === false || tags === null) {\n    return null;\n  }\n\n  const relativeFilePath = tags ?? DefaultTagsFileName;\n\n  // if returned path is defined, the file exists (localized or not)\n  const yamlFilePath = await getDataFilePath({\n    contentPaths,\n    filePath: relativeFilePath,\n  });\n\n  // If the tags option is undefined, don't throw when the file does not exist\n  // Retro-compatible behavior: existing sites do not yet have tags.yml\n  if (tags === undefined && !yamlFilePath) {\n    return null;\n  }\n  if (!yamlFilePath) {\n    throw new Error(\n      `No tags file '${relativeFilePath}' could be found in any of those directories:\\n- ${getContentPathList(\n        contentPaths,\n      ).join('\\n- ')}`,\n    );\n  }\n\n  const tagDefinitionContent = await fs.readFile(yamlFilePath, 'utf-8');\n  if (!tagDefinitionContent.trim()) {\n    return {};\n  }\n\n  const yamlContent = YAML.load(tagDefinitionContent);\n  const tagsFileInputResult = TagsFileInputSchema.validate(yamlContent);\n  if (tagsFileInputResult.error) {\n    throw new Error(\n      `There was an error extracting tags from file: ${tagsFileInputResult.error.message}`,\n      {cause: tagsFileInputResult},\n    );","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-utils-validation/src/tagsFile.ts#L88-L124","documentation":"Thrown by getTagsFile() when the tags option has been set to a string (a custom filename) but no matching file is found in either the localized content path or the base content path. The function uses getDataFilePath() to search both, and only returns null silently when tags is undefined (the retro-compatible case where a site has no tags.yml yet). Setting tags to any explicit value tells Docusaurus you intend to provide a tags file, so its absence is a hard error.","triggerScenarios":"A docs/blog plugin is configured with `tags: 'my-tags.yml'` (or `tags: true`) in docusaurus.config.js / plugin options, and that file does not exist in the content directory (docs/, blog/, or their i18n localized counterparts). The filename is misspelled, placed in the wrong directory, or the path is absolute when a relative one was expected.","commonSituations":"Renaming tags.yml without updating plugin config. Pointing tags at a file that lives in the repo root rather than the content folder. On Windows, casing mismatches in the filename. Setting `tags: true` expecting Docusaurus to create the file automatically — it does not, you must author it.","solutions":["Read the error: it lists every searched directory (the localized path first, then the base content path). Create the tags file in one of those exact directories.","Verify the filename you passed as the tags option matches the file on disk exactly (case-sensitive, with the .yml extension).","If you do not actually want a centralized tags file, remove the tags option (or set it to false / null) so getTagsFile returns null instead of throwing.","If you want the file auto-resolved by the default name, omit the tags option value and name the file tags.yml inside the content directory."],"exampleFix":"// before (docusaurus.config.js)\nplugins: [['@docusaurus/plugin-content-docs', { tags: 'tagz.yml' }]]\n// typo: file is tags.yml on disk\n\n// after\nplugins: [['@docusaurus/plugin-content-docs', { tags: 'tags.yml' }]]","handlingStrategy":"validation","validationCode":"import fs from 'fs-extra';\n\nasync function tagsFileExists(contentPaths, relativeFilePath) {\n  for (const dir of [contentPaths.contentPathLocalized, contentPaths.contentPath].filter(Boolean)) {\n    if (await fs.pathExists(path.join(dir, relativeFilePath))) return true;\n  }\n  return false;\n}\n\nif (typeof tags === 'string' && !(await tagsFileExists(contentPaths, tags))) {\n  throw new Error(`Config error: tags file '${tags}' not found in any content directory.`);\n}","typeGuard":"function isTagsFileOption(v: unknown): v is string | boolean | null | undefined {\n  return typeof v === 'string' || typeof v === 'boolean' || v === null || v === undefined;\n}","tryCatchPattern":"try {\n  await getTagsFile({ tags, contentPaths });\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('No tags file')) {\n    // create the file or unset the tags option\n  }\n  throw err;\n}","preventionTips":["If you set the tags option to a custom filename, create the file at the same time you commit the config change.","Keep the tags file in the same content directory (docs/ or blog/) the plugin reads from.","Set tags: false explicitly if you do not want centralized tags, instead of leaving a stale filename."],"tags":["tags","file-not-found","config","i18n"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}