{"record":{"id":"69b2faa18e47ffb1","repo":"remotion-dev/remotion","slug":"setimagesequence-accepts-a-boolean-value","errorCode":null,"errorMessage":"setImageSequence accepts a Boolean Value","messagePattern":"setImageSequence accepts a Boolean Value","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/config/image-sequence.ts","lineNumber":7,"sourceCode":"import type {FrameRange} from '@remotion/renderer';\n\nlet imageSequence = false;\n\nexport const setImageSequence = (newImageSequence: boolean) => {\n\tif (typeof newImageSequence !== 'boolean') {\n\t\tthrow new TypeError('setImageSequence accepts a Boolean Value');\n\t}\n\n\timageSequence = newImageSequence;\n};\n\nexport const getShouldOutputImageSequence = (frameRange: FrameRange | null) => {\n\treturn imageSequence || typeof frameRange === 'number';\n};\n","sourceCodeStart":1,"sourceCodeEnd":16,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cli/src/config/image-sequence.ts#L1-L16","documentation":"`Config.setImageSequence()` (packages/cli/src/config/image-sequence.ts) only accepts a real boolean. Passing any non-boolean value throws a TypeError because Remotion uses a strict runtime type guard rather than coercing. The flag controls whether rendering emits one image file per frame instead of a single video.","triggerScenarios":"Calling `Config.setImageSequence('true')`, `setImageSequence(1)`, `setImageSequence(undefined)`, or `setImageSequence(null)` from a remotion config file. Any truthy non-boolean trips the guard.","commonSituations":"Reading a value from `process.env.IMAGE_SEQUENCE` (always a string) and passing it straight through; deserializing a JSON/argv value that arrives as a string or number; copy-pasting from docs that show the literal `true` into a template that wraps it in quotes.","solutions":["Pass a literal boolean: `Config.setImageSequence(true)`.","If the value comes from env/argv, coerce explicitly: `Config.setImageSequence(process.env.IMAGE_SEQUENCE === 'true')`."],"exampleFix":"// before\nConfig.setImageSequence(process.env.IMAGE_SEQUENCE);\n// after\nConfig.setImageSequence(process.env.IMAGE_SEQUENCE === 'true');","handlingStrategy":"type-guard","validationCode":"const raw = process.env.IMAGE_SEQUENCE;\nif (raw !== undefined && typeof raw !== 'boolean' && raw !== 'true' && raw !== 'false') {\n  throw new Error('IMAGE_SEQUENCE must be \"true\", \"false\", or unset');\n}\nConfig.setImageSequence(raw === 'true');","typeGuard":"const isBoolean = (v: unknown): v is boolean => typeof v === 'boolean';","tryCatchPattern":null,"preventionTips":["Never pass env/argv values directly into typed config setters.","Wrap env reads in explicit boolean coercion helpers."],"tags":["config","validation","typescript","image-sequence"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}