{"record":{"id":"173bcb25697ef049","repo":"angular/components","slug":"invalid-value-this-fixedrowheight-set-as-rowh","errorCode":null,"errorMessage":"Invalid value \"${this.fixedRowHeight}\" set as rowHeight.","messagePattern":"Invalid value \"(.+?)\" set as rowHeight\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/material/grid-list/tile-styler.ts","lineNumber":184,"sourceCode":"/**\n * This type of styler is instantiated when the user passes in a fixed row height.\n * Example `<mat-grid-list cols=\"3\" rowHeight=\"100px\">`\n * @docs-private\n */\nexport class FixedTileStyler extends TileStyler {\n  constructor(public fixedRowHeight: string) {\n    super();\n  }\n\n  override init(gutterSize: string, tracker: TileCoordinator, cols: number, direction: string) {\n    super.init(gutterSize, tracker, cols, direction);\n    this.fixedRowHeight = normalizeUnits(this.fixedRowHeight);\n\n    if (\n      !cssCalcAllowedValue.test(this.fixedRowHeight) &&\n      (typeof ngDevMode === 'undefined' || ngDevMode)\n    ) {\n      throw Error(`Invalid value \"${this.fixedRowHeight}\" set as rowHeight.`);\n    }\n  }\n\n  override setRowStyles(tile: MatGridTile, rowIndex: number): void {\n    tile._setStyle('top', this.getTilePosition(this.fixedRowHeight, rowIndex));\n    tile._setStyle('height', calc(this.getTileSize(this.fixedRowHeight, tile.rowspan)));\n  }\n\n  override getComputedHeight(): [string, string] {\n    return ['height', calc(`${this.getTileSpan(this.fixedRowHeight)} + ${this.getGutterSpan()}`)];\n  }\n\n  override reset(list: TileStyleTarget) {\n    list._setListStyle(['height', null]);\n\n    if (list._tiles) {\n      list._tiles.forEach(tile => {\n        tile._setStyle('top', null);","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/angular/components/blob/0411926e7d8ae06b32236ec1048a888cfad5abf2/src/material/grid-list/tile-styler.ts#L166-L202","documentation":"When rowHeight is a fixed value (not a ratio like '1:1'), FixedRowStyler.init normalizes it and validates it against a CSS calc()-safe pattern. Any string that isn't a plain number or a valid CSS length unit (px, vh, em, etc.) is rejected with this error.","triggerScenarios":"Passing [rowHeight]=\"'100pixels'\" or other invalid units, an empty/whitespace string, or a value like '10 0px' to <mat-grid-list rowHeight=\"...\">; also passing an un-normalizable type that stringifies oddly.","commonSituations":"Typos in units ('pxx', 'px '), forgetting the unit entirely is OK (number) but suffix typos are not; binding a locale-formatted string like '100 px' with a non-breaking space; user-supplied config values flowing into rowHeight unchecked.","solutions":["Use a number (rowHeight=\"100\") or a valid CSS unit string (rowHeight=\"100px\").","Use a ratio string like rowHeight=\"1:1\" if proportional sizing was intended.","Sanitize user/config-provided values with a regex like /^\\d+(px|em|rem|vh|vw)?$/ before binding.","Log the offending value and check for invisible characters (non-breaking spaces) from copied strings."],"exampleFix":"// before\n<mat-grid-list cols=\"3\" rowHeight=\"100pixels\">\n// after\n<mat-grid-list cols=\"3\" rowHeight=\"100px\"></mat-grid-list>","handlingStrategy":"validation","validationCode":"const cssCalcAllowedValue = /^-?\\d+(\\.\\d+)?(px|%|em|rem|vh|vw|vmin|vmax|cm|mm|in|pt|pc|ex|ch|fr)?$/;\nfunction isValidRowHeight(v: string): boolean {\n  return cssCalcAllowedValue.test(v) || /^\\d+(\\.\\d+)?:\\d+(\\.\\d+)?$/.test(v);\n}","typeGuard":"function isFixedRowHeight(v: unknown): v is `${number}px` | `${number}` {\n  return typeof v === 'string' && /^-?\\d+(\\.\\d+)?(px)?$/.test(v.trim());\n}","tryCatchPattern":null,"preventionTips":["Use numbers for fixed heights (rowHeight=\"100\") or plain px strings.","Never paste strings with non-breaking or trailing spaces into unit values.","Validate any user/config-supplied rowHeight before binding."],"tags":["angular-material","grid-list","invalid-input","css-units"],"backgroundTag":"invalid-css-unit-value","analyzedSha":"0411926e7d8ae06b32236ec1048a888cfad5abf2","analyzedAt":"2026-08-31T11:58:23.400Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}