{"record":{"id":"1806b5f5858525cc","repo":"remotion-dev/remotion","slug":"timelinefontweightfield-rendered-for-non-font-weig","errorCode":null,"errorMessage":"TimelineFontWeightField rendered for non-font-weight field","messagePattern":"TimelineFontWeightField rendered for non-font-weight field","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/Timeline/TimelineFontWeightField.tsx","lineNumber":33,"sourceCode":"\nexport const TimelineFontWeightField: React.FC<{\n\treadonly field: SchemaFieldInfo;\n\treadonly propStatus: CanUpdateSequencePropStatusStatic;\n\treadonly effectiveValue: unknown;\n\treadonly onSave: TimelineFieldOnSave;\n\treadonly onDragValueChange: TimelineFieldOnDragValueChange;\n\treadonly onDragEnd: () => void;\n}> = ({\n\tfield,\n\tpropStatus,\n\teffectiveValue,\n\tonSave,\n\tonDragValueChange,\n\tonDragEnd,\n}) => {\n\tconst {fieldSchema} = field;\n\tif (fieldSchema.type !== 'font-weight') {\n\t\tthrow new Error(\n\t\t\t'TimelineFontWeightField rendered for non-font-weight field',\n\t\t);\n\t}\n\n\tconst sourceValue = propStatus.codeValue ?? fieldSchema.default;\n\tconst currentValue = effectiveValue ?? sourceValue;\n\n\tconst onSelectKeyword = useCallback(\n\t\t(newValue: string) => {\n\t\t\tif (newValue === propStatus.codeValue) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDragValueChange(newValue);\n\t\t\tonSave(newValue).finally(onDragEnd);\n\t\t},\n\t\t[onDragEnd, onDragValueChange, onSave, propStatus.codeValue],\n\t);","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/remotion-dev/remotion/blob/a6a7485a9aeb04219510fbe4874f8941486424df/packages/studio/src/components/Timeline/TimelineFontWeightField.tsx#L15-L51","documentation":"TimelineFontWeightField is a Studio timeline field component specialized for editing the CSS font-weight property. Its field schema is expected to have type 'font-weight'. If it receives a field whose schema type is anything else, it throws 'TimelineFontWeightField rendered for non-font-weight field' because rendering logic (values, drag behavior) only makes sense for font-weight schemas.","triggerScenarios":"Passing a field whose fieldSchema.type is not 'font-weight' (e.g. 'color', 'number', 'text') to TimelineFontWeightField — typically a schema-type/field-component mapping mistake in Studio's Zod-schema-to-component dispatch.","commonSituations":"Adding a new Zod schema type and forgetting to update the field-to-component mapping; custom schema extensions misrouted to the font-weight component; Studio version mismatch where schemas and field components disagree.","solutions":["Verify the field schema actually has type: 'font-weight' before rendering this component (inspect field.fieldSchema.type at the call site)","Fix the schema-type → field-component dispatch table so non-font-weight fields route to the correct component","If you added a custom schema type, register a matching timeline field component for it instead of reusing TimelineFontWeightField","Report as a bug if it happens with a plain Zod field in stock Remotion Studio"],"exampleFix":"// before\n<TimelineFontWeightField field={field} />\n// after\n{field.fieldSchema.type === 'font-weight'\n  ? <TimelineFontWeightField field={field} />\n  : <TimelineGenericField field={field} />}","handlingStrategy":"type-guard","validationCode":"if (field.fieldSchema.type !== 'font-weight') {\n  throw new Error('wrong field component'); // at the dispatch site\n}","typeGuard":"const isFontWeightField = (f: TimelineField): f is TimelineField & {fieldSchema: {type: 'font-weight'}} =>\n  f.fieldSchema.type === 'font-weight';","tryCatchPattern":"try {\n  return <TimelineFontWeightField field={field} />;\n} catch (err) {\n  if (err instanceof Error && err.message.includes('non-font-weight field')) {\n    return <TimelineGenericField field={field} />;\n  }\n  throw err;\n}","preventionTips":["Centralize the schema-type → field-component mapping and update it when adding schema types","Discriminate on fieldSchema.type before choosing a timeline field component","Add a unit test covering every schema type's component mapping","Avoid reusing specialized field components for other schema types"],"tags":["studio","typescript","invariant","schema"],"backgroundTag":"component-type-mismatch","analyzedSha":"a6a7485a9aeb04219510fbe4874f8941486424df","analyzedAt":"2026-09-02T16:25:19.997Z","contentChangedAt":"2026-09-02T16:25:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}