{"record":{"id":"b118ab2d68ad3d6e","repo":"facebook/docusaurus","slug":"docusaurus-couldn-t-generate-a-unique-hash-for-rou","errorCode":null,"errorMessage":"Docusaurus couldn't generate a unique hash for route ${routeConfig.path} (level=${level} - index=${index}).\\nThis is a bug, please report it here!\\nhttps://github.com/facebook/docusaurus/issues/10718","messagePattern":"Docusaurus couldn't generate a unique hash for route (.+?) \\(level=(.+?) - index=(.+?)\\)\\.\\\\nThis is a bug, please report it here!\\\\nhttps://github\\.com/facebook/docusaurus/issues/10718","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus/src/server/codegen/codegenRoutes.ts","lineNumber":246,"sourceCode":"  } {\n    const hashes = [\n      // // OG algo to keep former snapshots\n      () => simpleHash(JSON.stringify(routeConfig), 3),\n      // Other attempts, not ideal but good enough\n      // Technically we could use Math.random() here but it's annoying for tests\n      () => simpleHash(`${level}${index}`, 3),\n      () => simpleHash(JSON.stringify(routeConfig), 4),\n      () => simpleHash(`${level}${index}`, 4),\n    ];\n\n    for (const tryHash of hashes) {\n      const routeHash = tryHash();\n      const routeKey = `${routePath}-${routeHash}`;\n      if (!res.routesChunkNames[routeKey]) {\n        return {routeKey, routeHash};\n      }\n    }\n    throw new Error(\n      `Docusaurus couldn't generate a unique hash for route ${routeConfig.path} (level=${level} - index=${index}).\nThis is a bug, please report it here!\nhttps://github.com/facebook/docusaurus/issues/10718`,\n    );\n  }\n\n  const {routeKey, routeHash} = generateUniqueRouteKey();\n\n  res.routesChunkNames[routeKey] = {\n    // Avoid clash with a prop called \"component\"\n    ...genChunkNames({__comp: component}, 'component', component, res),\n    ...(context &&\n      genChunkNames({__context: context}, 'context', routePath, res)),\n    ...genChunkNames(modules, 'module', routePath, res),\n  };\n\n  return serializeRouteConfig({\n    routePath: routePath.replace(/'/g, \"\\\\'\"),","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus/src/server/codegen/codegenRoutes.ts#L228-L264","documentation":"Thrown by `generateUniqueRouteKey` when all three hash attempts collide with already-registered route keys. Docusaurus generates short hashes to name route chunks; if two routes produce identical hashes at every fallback length, the routing codegen cannot disambiguate them. The message explicitly says this is a bug to report at facebook/docusaurus#10718.","triggerScenarios":"Two or more routes with the same path and structurally similar config exhaust the 3 hash strategies (level+index hash, JSON-of-config hash, longer level+index hash). Extremely rare; the code comment links it to a known hash-collision issue.","commonSituations":"Sites with hundreds/thousands of auto-generated routes that happen to collide; unusual route config shapes that hash identically; observed after a Docusaurus upgrade that changed the hashing strategy.","solutions":["Report the bug at https://github.com/facebook/docusaurus/issues/10718 with the route path, level, index, and Docusaurus version.","As a workaround, slightly differentiate the colliding routes' configs (e.g. distinct `priority`, `metadata`, or path) so the JSON-hash fallback differs.","Upgrade to the latest Docusaurus patch release — collision fixes may already be shipped.","Reduce the number of generated routes (e.g. paginate, split into multiple plugin instances) to lower collision probability."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return generateUniqueRouteKey();\n} catch (e) {\n  // log route + level + index and report upstream; do not silently retry\n  throw e;\n}","preventionTips":["Differentiate large route sets with distinct metadata to avoid hash collisions.","Keep Docusaurus patched to pick up hashing fixes.","Report collisions with full route context to facebook/docusaurus#10718."],"tags":["routing","codegen","hashing","internal","bug"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}