{"record":{"id":"9f07963045a16a03","repo":"nestjs/nest","slug":"route-method-shadowedpath-shadowedhandler","errorCode":null,"errorMessage":"Route ${method} ${shadowedPath} (${shadowedHandlerLabel}) is shadowed by ${method} ${winnerPath} (${winnerHandlerLabel}). The first-registered route will match all matching requests on order-sensitive adapters.","messagePattern":"Route (.+?) (.+?) \\((.+?)\\) is shadowed by (.+?) (.+?) \\((.+?)\\)\\. The first-registered route will match all matching requests on order-sensitive adapters\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/router/route-conflict-detector.ts","lineNumber":194,"sourceCode":"   * conflict into a single `RouteConflictException`.\n   */\n  public static handle(\n    conflicts: RouteConflict[],\n    policy: RouteConflictPolicy | undefined,\n    logger: Logger,\n  ): void {\n    if (conflicts.length === 0 || policy === undefined) return;\n\n    const errorMessages: string[] = [];\n\n    conflicts.forEach(conflict => {\n      const policyForKind = policy[conflict.kind] ?? 'off';\n      if (policyForKind === 'off') return;\n\n      const message = RouteConflictDetector.describeConflict(conflict);\n\n      if (policyForKind === 'warn') {\n        logger.warn(message);\n        return;\n      }\n      errorMessages.push(message);\n    });\n\n    if (errorMessages.length > 0) {\n      throw new RouteConflictException(errorMessages);\n    }\n  }\n\n  /**\n   * Removes shadow conflicts that specificity sorting has already resolved.\n   *\n   * When `routeResolutionStrategy: 'specificity'` is active, the sort\n   * promotes more-specific routes ahead of less-specific ones. A shadow\n   * where the sort promoted the winner (it was declared *later* but sorted\n   * *first*) is handled correctly at runtime — the more-specific route is\n   * registered first and handles its requests while the less-specific route","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/nestjs/nest/blob/dd75d7bd8c5e88048587e6768d36eb695f3e7a25/packages/core/router/route-conflict-detector.ts#L176-L212","documentation":"Error \"Route ${method} ${shadowedPath} (${shadowedHandlerLabel}) is shadowed by ${method} ${winnerPath} (${winnerHandlerLabel}). The first-registered route will match all matching requests on order-sensitive adapters.\" thrown in nestjs/nest.","triggerScenarios":"Thrown at packages/core/router/route-conflict-detector.ts:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd75d7bd8c5e88048587e6768d36eb695f3e7a25","analyzedAt":"2026-08-21T19:39:39.867Z","contentChangedAt":"2026-08-21T19:39:39.867Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}