{"record":{"id":"f0a5435ed0ee9bb9","repo":"remotion-dev/remotion","slug":"sequence-with-premountfor-and-postmountfor","errorCode":null,"errorMessage":"`<Sequence>` with `premountFor` and `postmountFor` props does not support layout=\"none\"","messagePattern":"`<Sequence>` with `premountFor` and `postmountFor` props does not support layout=\"none\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/Sequence.tsx","lineNumber":654,"sourceCode":"\t\t\t\t\tref={sequenceRef}\n\t\t\t\t\tstyle={defaultStyle}\n\t\t\t\t\tclassName={other.className}\n\t\t\t\t>\n\t\t\t\t\t{frozenContent}\n\t\t\t\t</AbsoluteFillElement>\n\t\t\t)}\n\t\t</SequenceContext.Provider>\n\t);\n};\n\nconst RegularSequence = forwardRef(RegularSequenceRefForwardingFunction);\n\nconst PremountedPostmountedSequenceRefForwardingFunction: React.ForwardRefRenderFunction<\n\tHTMLDivElement,\n\tSequenceProps\n> = (props, ref) => {\n\tif (props.layout === 'none') {\n\t\tthrow new Error(\n\t\t\t'`<Sequence>` with `premountFor` and `postmountFor` props does not support layout=\"none\"',\n\t\t);\n\t}\n\n\tconst {\n\t\tstyle: passedStyle,\n\t\tfrom = 0,\n\t\tdurationInFrames = Infinity,\n\t\tpremountFor = 0,\n\t\tpostmountFor = 0,\n\t\tstyleWhilePremounted,\n\t\tstyleWhilePostmounted,\n\t\t...otherProps\n\t} = props;\n\n\tconst {\n\t\tfreezeFrame,\n\t\tisPremountingOrPostmounting,","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/Sequence.tsx#L636-L672","documentation":"Thrown by the premount/postmount variant of <Sequence> when layout=\"none\" is also passed. Premounting and postmounting rely on a wrapping element to apply premount/postmount styles and lifecycle, which layout=\"none\" cannot provide.","triggerScenarios":"Passing both premountFor (or postmountFor) and layout=\"none\" to <Sequence>. The dedicated PremountedPostmountedSequence code path immediately rejects this.","commonSituations":"Optimizing perceived load time with premountFor then switching to layout=\"none\" without removing premount props; copying props between sequences verbatim.","solutions":["Remove layout=\"none\" when using premountFor/postmountFor.","Remove premountFor/postmountFor when you need layout=\"none\".","Re-architect: keep the layout default and style the wrapper, or use a separate sequence for premounted content."],"exampleFix":"// before\n<Sequence premountFor={30} layout=\"none\">...</Sequence>\n\n// after\n<Sequence premountFor={30}>...</Sequence>","handlingStrategy":"validation","validationCode":"const hasPremount = (premountFor ?? 0) > 0 || (postmountFor ?? 0) > 0;\nif (hasPremount && layout === 'none') {\n  throw new Error('premount/postmount requires a wrapping layout');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat premountFor/postmountFor and layout=\"none\" as mutually exclusive in shared components.","Review prop spreads when reusing sequence components."],"tags":["sequence","layout","premount","props"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}