{"record":{"id":"d6ff80d3c6d638b3","repo":"remotion-dev/remotion","slug":"the-name-prop-of-componentname-must-be-bet","errorCode":null,"errorMessage":"The \"${name}\" prop of ${componentName} must be between 0 and 1, but got ${value}.","messagePattern":"The \"(.+?)\" prop of (.+?) must be between 0 and 1, but got (.+?)\\.","errorType":"validation","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/sequence-crop.ts","lineNumber":99,"sourceCode":"};\n\nexport const validateSequenceCrop = (\n\tcrop: SequenceCropInput,\n\tcomponentName = '<Sequence />',\n): void => {\n\tfor (const [name, value] of Object.entries(crop)) {\n\t\tif (value === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof value !== 'number' || !Number.isFinite(value)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`The \"${name}\" prop of ${componentName} must be a finite number, but got ${String(value)}.`,\n\t\t\t);\n\t\t}\n\n\t\tif (value < 0 || value > 1) {\n\t\t\tthrow new RangeError(\n\t\t\t\t`The \"${name}\" prop of ${componentName} must be between 0 and 1, but got ${value}.`,\n\t\t\t);\n\t\t}\n\t}\n};\n","sourceCodeStart":81,"sourceCodeEnd":105,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/sequence-crop.ts#L81-L105","documentation":"After confirming the crop value is a finite number, validateSequenceCrop requires it within [0,1] because crop values represent a fraction of the frame dimension to crop. Values below 0 or above 1 are meaningless and throw a RangeError.","triggerScenarios":"crop={{left: 1.5}}, crop={{top: -0.2}}, crop={{right: 2}}, crop={{left: 100}} (confusing pixels/fractions).","commonSituations":"Confusing the 0–1 fraction with pixel values or with a 0–100 percentage; passing raw pixel measurements.","solutions":["Use fractions between 0 and 1: crop={{left: 0.25}}.","Convert pixels to a fraction: leftPx / frameWidth."],"exampleFix":"// before\ncrop={{left: 100}}\n// after\ncrop={{left: 100 / width}}","handlingStrategy":"validation","validationCode":"function clamp01(c) {\n  const out = {};\n  for (const [k, v] of Object.entries(c)) {\n    if (v === undefined) continue;\n    out[k] = Math.min(1, Math.max(0, v));\n  }\n  return out;\n}","typeGuard":"const isCropFraction = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v >= 0 && v <= 1;","tryCatchPattern":null,"preventionTips":["Treat crop values as 0–1 fractions, not pixels or percentages.","Convert pixels: px / frameDimension before passing.","Validate ranges at the input layer."],"tags":["sequence","crop","validation","props","range"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}