{"record":{"id":"60a47b0e6df89ba0","repo":"remotion-dev/remotion","slug":"expected-a-keyword-and-a-length-percentage-value","errorCode":null,"errorMessage":"Expected a keyword and a length-percentage value","messagePattern":"Expected a keyword and a length-percentage value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":322,"sourceCode":"\t\t\tsecond.keyword,\n\t\t\tvalue,\n\t\t);\n\t}\n\n\tconst keyword =\n\t\tfirst.type === 'keyword'\n\t\t\t? first\n\t\t\t: second.type === 'keyword'\n\t\t\t\t? second\n\t\t\t\t: null;\n\tconst length =\n\t\tfirst.type === 'length-percentage'\n\t\t\t? first.parsed\n\t\t\t: second.type === 'length-percentage'\n\t\t\t\t? second.parsed\n\t\t\t\t: null;\n\tif (keyword === null || length === null) {\n\t\tthrow new Error('Expected a keyword and a length-percentage value');\n\t}\n\n\tconst keywordIsFirst = first.type === 'keyword';\n\n\tif (keyword.keyword === 'left' || keyword.keyword === 'right') {\n\t\tif (!keywordIsFirst) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Cannot interpolate \"${value}\" because horizontal transform-origin keywords must come before a length-percentage value`,\n\t\t\t);\n\t\t}\n\n\t\treturn [transformOriginKeywordOptions(keyword.keyword)[0].value, length];\n\t}\n\n\tif (keyword.keyword === 'top' || keyword.keyword === 'bottom') {\n\t\treturn [length, transformOriginKeywordOptions(keyword.keyword)[0].value];\n\t}\n","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L304-L340","documentation":"Thrown by parseTransformOriginXY as an internal assertion when, in the mixed keyword + length-percentage branch, it cannot locate both a keyword token and a length-percentage token. Control flow only enters that branch when exactly one of the two tokens is a keyword and the other is a length-percentage, so both should always be present; this Error is a defensive invariant check rather than a user-facing condition.","triggerScenarios":"Not reachable through the public interpolate() API under normal use; it would require an internal inconsistency between parseTransformOriginToken classification and the branch dispatch.","commonSituations":"Effectively unreachable. If observed, it indicates a bug in Remotion's transform-origin parser rather than user input.","solutions":["Report the input string that triggered it as a Remotion bug.","As a workaround, rewrite the transform-origin using explicit length-percentage values for both axes."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return interpolate(input, inputRange, outputRange, options);\n} catch (err) {\n  if (err instanceof Error && err.message === 'Expected a keyword and a length-percentage value') {\n    // Internal assertion: report upstream and fall back to explicit length values.\n    return interpolate(input, inputRange, outputRange.map(() => '50% 50%'), options);\n  }\n  throw err;\n}","preventionTips":["Treat this message as a Remotion parser bug; report the exact input string.","Prefer fully-numeric transform-origin values (\"50% 50%\") to sidestep keyword/length pairing logic."],"tags":["interpolate","transform-origin","defensive","internal-assertion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}