{"record":{"id":"291eb6c671f6d368","repo":"angular/components","slug":"a-hint-was-already-declared-for-align-end","errorCode":null,"errorMessage":"A hint was already declared for 'align=\"end\"'.","messagePattern":"A hint was already declared for 'align=\"end\"'\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/material/form-field/form-field.ts","lineNumber":683,"sourceCode":"  /**\n   * Ensure that there is a maximum of one of each \"mat-hint\" alignment specified. The hint\n   * label specified set through the input is being considered as \"start\" aligned.\n   *\n   * This method is a noop if Angular runs in production mode.\n   */\n  private _validateHints() {\n    if (this._hintChildren && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n      let startHint: MatHint;\n      let endHint: MatHint;\n      this._hintChildren.forEach((hint: MatHint) => {\n        if (hint.align === 'start') {\n          if (startHint || this.hintLabel) {\n            throw getMatFormFieldDuplicatedHintError('start');\n          }\n          startHint = hint;\n        } else if (hint.align === 'end') {\n          if (endHint) {\n            throw getMatFormFieldDuplicatedHintError('end');\n          }\n          endHint = hint;\n        }\n      });\n    }\n  }\n\n  /**\n   * Sets the list of element IDs that describe the child control. This allows the control to update\n   * its `aria-describedby` attribute accordingly.\n   */\n  private _syncDescribedByIds() {\n    if (this._control) {\n      let ids: string[] = [];\n\n      // TODO(wagnermaciel): Remove the type check when we find the root cause of this bug.\n      if (\n        this._control.userAriaDescribedBy &&","sourceCodeStart":665,"sourceCodeEnd":701,"githubUrl":"https://github.com/angular/components/blob/0411926e7d8ae06b32236ec1048a888cfad5abf2/src/material/form-field/form-field.ts#L665-L701","documentation":"MatFormField allows at most one hint per alignment ('start' and 'end') among its <mat-hint> children and the hintLabel input. This error is thrown when a second hint with the same alignment is projected into the form field, because two hints at the same position cannot be rendered.","triggerScenarios":"Rendering a MatFormField containing two <mat-hint align=\"end\"> elements (or two <mat-hint align=\"start\">, or a hint duplicating the hintLabel input); the check runs when hints are re-evaluated via _processHints during content init or ContentChildren changes.","commonSituations":"Duplicating a validation hint in a template with *ngIf branches that both render align=\"end\" hints; combining hintLabel with a <mat-hint align=\"end\"> while also adding another end-aligned hint after a copy/paste refactor; rendering hints from a loop without keys.","solutions":["Remove or consolidate the duplicate <mat-hint> so only one hint exists per alignment.","Give extra hints the opposite align value (e.g. align=\"start\") so they occupy the free slot.","If the hint is conditional, ensure only one branch can be active at a time (use if/else rather than two independent *ngIf).","Replace the second static hint with the hintLabel input or merge the messages into a single hint element."],"exampleFix":"// before\n<mat-form-field>\n  <mat-hint align=\"end\">Min 8 chars</mat-hint>\n  <mat-hint align=\"end\">Max 64 chars</mat-hint>\n</mat-form-field>\n// after\n<mat-form-field>\n  <mat-hint align=\"start\">Max 64 chars</mat-hint>\n  <mat-hint align=\"end\">Min 8 chars</mat-hint>\n</mat-form-field>","handlingStrategy":"validation","validationCode":"// template-level check before rendering hints\n// ensure at most one hint per align value:\nconst startHints = hintList.filter(h => h.align === 'start');\nconst endHints = hintList.filter(h => h.align === 'end');\nif (startHints.length > 1 || endHints.length > 1) {\n  throw new Error('Only one mat-hint allowed per align value');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use at most one <mat-hint> per align value per form field.","Prefer *ngIf/else branches (single element) over two separate conditional hints with the same align.","Use mat-error for validation messages and reserve mat-hint for static help text."],"tags":["angular-material","form-field","template-error","duplicate-hint"],"backgroundTag":"duplicate-hint-declared","analyzedSha":"0411926e7d8ae06b32236ec1048a888cfad5abf2","analyzedAt":"2026-08-31T11:58:23.400Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}