{"record":{"id":"15eee793104d13b6","repo":"remotion-dev/remotion","slug":"the-offset-property-of-a-series-sequence-mus","errorCode":null,"errorMessage":"The \"offset\" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).","messagePattern":"The \"offset\" property of a <Series\\.Sequence /> must not be NaN, but got NaN \\((.+?)\\)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/series/index.tsx","lineNumber":125,"sourceCode":"\tindex,\n\tchildrenLength,\n}: {\n\treadonly durationInFrames: number;\n\treadonly offset: number | undefined;\n\treadonly index: number;\n\treadonly childrenLength: number;\n}) => {\n\tconst debugInfo = `index = ${index}, duration = ${durationInFrames}`;\n\tif (index !== childrenLength - 1 || durationInFrames !== Infinity) {\n\t\tvalidateDurationInFrames(durationInFrames, {\n\t\t\tcomponent: `of a <Series.Sequence /> component`,\n\t\t\tallowFloats: true,\n\t\t});\n\t}\n\n\tconst offset = offsetProp ?? 0;\n\tif (Number.isNaN(offset)) {\n\t\tthrow new TypeError(\n\t\t\t`The \"offset\" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`,\n\t\t);\n\t}\n\n\tif (!Number.isFinite(offset)) {\n\t\tthrow new TypeError(\n\t\t\t`The \"offset\" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`,\n\t\t);\n\t}\n\n\tif (offset % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`The \"offset\" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`,\n\t\t);\n\t}\n\n\treturn offset;\n};","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/series/index.tsx#L107-L143","documentation":"The optional `offset` prop of <Series.Sequence> (a gap/overlap in frames between sequences) defaults to 0 via `offsetProp ?? 0`. If explicitly NaN, it throws because NaN propagates through the start-frame arithmetic and would silently corrupt the series layout.","triggerScenarios":"offset={NaN}, offset={Number('x')}, offset from parseInt('') , or any calculation producing NaN.","commonSituations":"Parsing user input with parseInt without validation; conditional returning undefined that gets coerced; math on undefined operands.","solutions":["Omit offset to use the default of 0 rather than passing NaN.","Sanitize before passing: offset={Number.isFinite(v) ? v : undefined}.","Fix the upstream calculation so it never yields NaN."],"exampleFix":"// before\n<Series.Sequence offset={parseInt(userVal)} />\n// after\n<Series.Sequence offset={Number.isFinite(parseInt(userVal)) ? parseInt(userVal) : undefined} />","handlingStrategy":"validation","validationCode":"const safeOffset = Number.isFinite(rawOffset) ? rawOffset : undefined;","typeGuard":"const isValidOffset = (v: unknown): v is number =>\n  typeof v === 'number' && !Number.isNaN(v);","tryCatchPattern":null,"preventionTips":["Omit offset instead of passing NaN.","Sanitize parsed input with Number.isFinite before assigning.","Guard arithmetic that may operate on undefined operands."],"tags":["series","validation","props"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}