{"record":{"id":"265139bcec0a95dc","repo":"remotion-dev/remotion","slug":"outputtype-must-be-font-weight-scale-translate-rotate-or","errorCode":null,"errorMessage":"outputType must be \"font-weight\", \"scale\", \"translate\", \"rotate\", or \"transform-origin\", but got ${String(outputType)}","messagePattern":"outputType must be \"font-weight\", \"scale\", \"translate\", \"rotate\", or \"transform-origin\", but got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1232,"sourceCode":"\t\t`output must be \"linear\" or \"perceptual-scale\", but got ${String(output)}`,\n\t);\n}\n\nfunction assertValidInterpolateOutputType(\n\toutputType: InterpolateOptions['outputType'],\n) {\n\tif (\n\t\toutputType === undefined ||\n\t\toutputType === 'font-weight' ||\n\t\toutputType === 'scale' ||\n\t\toutputType === 'translate' ||\n\t\toutputType === 'rotate' ||\n\t\toutputType === 'transform-origin'\n\t) {\n\t\treturn;\n\t}\n\n\tthrow new Error(\n\t\t`outputType must be \"font-weight\", \"scale\", \"translate\", \"rotate\", or \"transform-origin\", but got ${String(outputType)}`,\n\t);\n}\n\n/*\n * @description Allows you to map a range of values to another using a concise syntax.\n * @see [Documentation](https://remotion.dev/docs/interpolate)\n */\n/* eslint-disable no-redeclare */\nexport function interpolate(\n\tinput: number,\n\tinputRange: readonly number[],\n\toutputRange: readonly number[],\n\toptions?: InterpolateOptions,\n): number;\nexport function interpolate(\n\tinput: number,\n\tinputRange: readonly number[],","sourceCodeStart":1214,"sourceCodeEnd":1250,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/core/src/interpolate.ts#L1214-L1250","documentation":"interpolateColors (and related helpers) accepts an `outputType` option that must be one of the string literals 'font-weight', 'scale', 'translate', 'rotate', or 'transform-origin'. Remotion throws this error when any other value is passed, to fail fast instead of producing broken CSS. It is a guard on the public `interpolateColors(input, inputRange, outputRange, options)` API in packages/core/src/interpolate.ts.","triggerScenarios":"Calling `interpolateColors` with an options object whose `outputType` is misspelled (e.g. 'translates', 'Translate', 'transformOrigin') or of the wrong type (a number, enum, or variable holding an unexpected value).","commonSituations":"Typos after refactoring, copying an option from another library, building the options object dynamically from a variable that no longer matches the allowed literals, or passing camelCase instead of the kebab-case literal.","solutions":["Check the value passed as `outputType` and use exactly one of: 'font-weight', 'scale', 'translate', 'rotate', 'transform-origin'.","Fix casing: the literals are lowercase kebab-case, e.g. 'transform-origin' not 'transformOrigin'.","If the value comes from a variable, log String(outputType) before the call to see what it actually holds.","If you don't need special CSS-unit handling, omit `outputType` entirely."],"exampleFix":"// before\ninterpolateColors(0.5, [0, 1], ['#fff', '#000'], {outputType: 'transformOrigin'});\n// after\ninterpolateColors(0.5, [0, 1], ['#fff', '#000'], {outputType: 'transform-origin'});","handlingStrategy":"validation","validationCode":"const ALLOWED = ['font-weight','scale','translate','rotate','transform-origin'];\nif (outputType !== undefined && !ALLOWED.includes(outputType)) {\n  throw new Error(`Invalid outputType: ${String(outputType)}`);\n}","typeGuard":"const isOutputType = (v: unknown): v is 'font-weight'|'scale'|'translate'|'rotate'|'transform-origin' =>\n  typeof v === 'string' && ['font-weight','scale','translate','rotate','transform-origin'].includes(v);","tryCatchPattern":"try {\n  return interpolateColors(input, inputRange, outputRange, {outputType});\n} catch (e) {\n  if (e instanceof Error && e.message.includes('outputType must be')) {\n    console.error(`Bad outputType ${String(outputType)}; allowed: font-weight, scale, translate, rotate, transform-origin`);\n  }\n  throw e;\n}","preventionTips":["Type the outputType variable with the exported union type so TypeScript rejects typos.","Always use the lowercase kebab-case literals ('transform-origin', not 'transformOrigin').","Log dynamic outputType values before calling interpolateColors.","Omit the option when you don't need CSS-unit handling."],"tags":["validation","interpolation","invalid-argument"],"backgroundTag":"invalid-enum-value","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}