{"record":{"id":"28c7deb72d2e0f50","repo":"remotion-dev/remotion","slug":"the-nameofprop-prop-location-must-be-posit","errorCode":null,"errorMessage":"The \"${nameOfProp}\" prop ${location} must be positive, but got ${amount}.","messagePattern":"The \"(.+?)\" prop (.+?) must be positive, but got (.+?)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-dimensions.ts","lineNumber":31,"sourceCode":"\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":13,"sourceCodeEnd":36,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-dimensions.ts#L13-L36","documentation":"`validateDimension` requires `width`/`height` to be strictly positive (> 0). Zero or negative dimensions are rejected as the last dimension check, since a render needs at least one pixel on each axis.","triggerScenarios":"Setting `width`/`height` to `0`, a negative number, or a value that computes to <= 0 (e.g. subtraction overshoot, `Math.min` of negatives).","commonSituations":"A dynamic layout where a region collapses to 0 (empty content); subtracting padding that exceeds the size; sign errors in computation.","solutions":["Ensure dimensions are at least 1; clamp: `Math.max(1, value)`.","Treat 0/negative as an error and supply a real default.","Check `> 0` before assigning."],"exampleFix":"// before\nconst width = baseWidth - padding * 2; // can be <= 0\n<Composition width={width} ... />\n// after\nconst width = Math.max(1, baseWidth - padding * 2);\n<Composition width={width} ... />","handlingStrategy":"validation","validationCode":"if (w <= 0) { throw new Error('width must be positive'); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp computed dimensions to a minimum of 1.","Guard against padding/subtraction overshoot producing 0."],"tags":["validation","composition","dimensions","positive"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}