{"record":{"id":"822fc9c2cbb1efbe","repo":"facebook/docusaurus","slug":"unexpected-reportingseverity-value-reportings","errorCode":null,"errorMessage":"Unexpected \"reportingSeverity\" value: ${reportingSeverity}.","messagePattern":"Unexpected \"reportingSeverity\" value: (.+?)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-logger/src/logger.ts","lineNumber":170,"sourceCode":" * - `throw`: aborts the process, throws the error.\n *\n * Since the logger doesn't have logging level filters yet, these severities\n * mostly just differ by their colors.\n *\n * @throws In addition to throwing when `reportingSeverity === \"throw\"`, this\n * function also throws if `reportingSeverity` is not one of the above.\n */\nfunction report(reportingSeverity: ReportingSeverity): typeof success {\n  const reportingMethods = {\n    ignore: () => {},\n    log: info,\n    warn,\n    throw: throwError,\n  };\n  if (\n    !Object.prototype.hasOwnProperty.call(reportingMethods, reportingSeverity)\n  ) {\n    throw new Error(\n      `Unexpected \"reportingSeverity\" value: ${reportingSeverity}.`,\n    );\n  }\n  return reportingMethods[reportingSeverity];\n}\n\nconst logger = {\n  red: (msg: string | number): string => chalk.red(msg),\n  yellow: (msg: string | number): string => chalk.yellow(msg),\n  green: (msg: string | number): string => chalk.green(msg),\n  cyan: (msg: string | number): string => chalk.cyan(msg),\n  bold: (msg: string | number): string => chalk.bold(msg),\n  dim: (msg: string | number): string => chalk.dim(msg),\n  path,\n  url,\n  name,\n  code,\n  subdue,","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-logger/src/logger.ts#L152-L188","documentation":"Thrown by logger.report() in @docusaurus/logger when the reportingSeverity argument is not one of the known keys: 'ignore', 'log', 'warn', 'throw'. report() looks up a handler in a fixed object and rejects unknown values rather than silently no-op'ing. This normally reflects a config typo in onDuplicateRoutes / onBrokenLinks / onBrokenMarkdownLinks or a programmer error passing an unvalidated string.","triggerScenarios":"Setting onBrokenLinks (or onDuplicateRoutes, onBrokenMarkdownLinks) in docusaurus.config to a value like 'error', 'raise', 'warn ' (trailing space), or any string other than the four allowed. report() is then called with that value and throws.","commonSituations":"Intuitively writing onBrokenLinks: 'error' instead of 'throw'; copying a config between Docusaurus versions where severity names changed; a plugin forwarding a user-supplied severity string without validation.","solutions":["Set the severity to one of: 'ignore' | 'log' | 'warn' | 'throw'.","Search docusaurus.config for onBrokenLinks, onBrokenMarkdownLinks, onDuplicateRoutes and fix each value.","If the value comes from a plugin option, validate it against the ReportingSeverity union before forwarding to logger.report."],"exampleFix":"// before\nonBrokenLinks: 'error',\n// after\nonBrokenLinks: 'throw',","handlingStrategy":"type-guard","validationCode":"import type {ReportingSeverity} from '@docusaurus/types';\nconst SEVERITIES: ReportingSeverity[] = ['ignore', 'log', 'warn', 'throw'];\nfunction assertSeverity(v: string): asserts v is ReportingSeverity {\n  if (!SEVERITIES.includes(v as ReportingSeverity)) {\n    throw new Error(`Unexpected reportingSeverity value: ${v}`);\n  }\n}","typeGuard":"import type {ReportingSeverity} from '@docusaurus/types';\nconst isReportingSeverity = (v: unknown): v is ReportingSeverity =>\n  v === 'ignore' || v === 'log' || v === 'warn' || v === 'throw';","tryCatchPattern":null,"preventionTips":["Restrict severity config values to the four allowed literals; document them at the config site.","If forwarding a user-supplied severity, narrow it with isReportingSeverity first.","Add a JSON-schema/enum check on docusaurus.config in CI."],"tags":["logger","config","reporting-severity","validation"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}