{"record":{"id":"cbebd136c5f2b30d","repo":"remotion-dev/remotion","slug":"the-nameofprop-prop-location-must-be-an-in","errorCode":null,"errorMessage":"The \"${nameOfProp}\" prop ${location} must be an integer, but is ${amount}.","messagePattern":"The \"(.+?)\" prop (.+?) must be an integer, but is (.+?)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-dimensions.ts","lineNumber":25,"sourceCode":"\t\tthrow new Error(\n\t\t\t`The \"${nameOfProp}\" prop ${location} must be a number, but you passed a value of type ${typeof amount}`,\n\t\t);\n\t}\n\n\tif (isNaN(amount)) {\n\t\tthrow new TypeError(\n\t\t\t`The \"${nameOfProp}\" prop ${location} must not be NaN, but is NaN.`,\n\t\t);\n\t}\n\n\tif (!Number.isFinite(amount)) {\n\t\tthrow new TypeError(\n\t\t\t`The \"${nameOfProp}\" prop ${location} must be finite, but is ${amount}.`,\n\t\t);\n\t}\n\n\tif (amount % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`The \"${nameOfProp}\" prop ${location} must be an integer, but is ${amount}.`,\n\t\t);\n\t}\n\n\tif (amount <= 0) {\n\t\tthrow new TypeError(\n\t\t\t`The \"${nameOfProp}\" prop ${location} must be positive, but got ${amount}.`,\n\t\t);\n\t}\n}\n","sourceCodeStart":7,"sourceCodeEnd":36,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-dimensions.ts#L7-L36","documentation":"`validateDimension` requires `width`/`height` to be integers — fractional pixel dimensions are not allowed because frame buffers are addressed in whole pixels. This check runs after the NaN/finite checks.","triggerScenarios":"Setting `width`/`height` to a fractional number such as `1920.5`, or deriving a dimension from a division that is not a whole number (`1920 / 2` is fine, `1920 / 3 = 640` is fine, but `1000 / 3 ≈ 333.33` is not).","commonSituations":"Scaling dimensions by an aspect ratio that yields non-integer results; computing height from width and a non-divisor ratio; rounding omissions in responsive layout code.","solutions":["Round the result: `Math.round(value)`.","Choose aspect ratios that divide evenly, or pick the nearest integer.","Validate with `Number.isInteger()` before assigning."],"exampleFix":"// before\nconst height = width * (9 / 16); // fractional for many widths\n<Composition width={width} height={height} ... />\n// after\nconst height = Math.round(width * (9 / 16));\n<Composition width={width} height={height} ... />","handlingStrategy":"validation","validationCode":"if (w % 1 !== 0) { throw new Error('width must be an integer'); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always Math.round() computed dimensions.","Verify Number.isInteger() before passing to <Composition>."],"tags":["validation","composition","dimensions","integer"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}