{"record":{"id":"b2d6c2f30e7c244e","repo":"remotion-dev/remotion","slug":"forcefullsequences-must-be-a-boolean","errorCode":null,"errorMessage":"forceFullSequences must be a boolean.","messagePattern":"forceFullSequences must be a boolean\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/whisper-webgpu/src/transcribe.ts","lineNumber":83,"sourceCode":"\n\tif (!Number.isFinite(chunkLengthInSeconds) || chunkLengthInSeconds <= 0) {\n\t\tthrow new Error(\n\t\t\t'chunkLengthInSeconds must be a finite number greater than 0.',\n\t\t);\n\t}\n\n\tif (\n\t\t!Number.isFinite(strideLengthInSeconds) ||\n\t\tstrideLengthInSeconds < 0 ||\n\t\tstrideLengthInSeconds * 2 >= chunkLengthInSeconds\n\t) {\n\t\tthrow new Error(\n\t\t\t'strideLengthInSeconds must be a finite, non-negative number and less than half of chunkLengthInSeconds.',\n\t\t);\n\t}\n\n\tif (typeof forceFullSequences !== 'boolean') {\n\t\tthrow new TypeError('forceFullSequences must be a boolean.');\n\t}\n\n\tif (typeof doSample !== 'boolean') {\n\t\tthrow new TypeError('doSample must be a boolean.');\n\t}\n\n\tif (!Number.isFinite(temperature) || temperature <= 0) {\n\t\tthrow new TypeError('temperature must be a finite number greater than 0.');\n\t}\n\n\tif (!Number.isInteger(topK) || topK < 0) {\n\t\tthrow new TypeError('topK must be a non-negative integer.');\n\t}\n\n\tif (!Number.isFinite(repetitionPenalty) || repetitionPenalty <= 0) {\n\t\tthrow new TypeError(\n\t\t\t'repetitionPenalty must be a finite number greater than 0.',\n\t\t);","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/whisper-webgpu/src/transcribe.ts#L65-L101","documentation":"transcribe() in @remotion/whisper-webgpu validates its decoding options: forceFullSequences (after chunk/stride checks) must be a strict boolean because it toggles whether Whisper decodes whole sequences; any non-boolean value is rejected with a TypeError.","triggerScenarios":"Passing forceFullSequences as undefined (option omitted while being read from an untyped config), as the string 'true', or as 1/0 from a CLI flag parsed without boolean conversion.","commonSituations":"Options assembled from environment variables or query strings that are still strings; optional fields left unset from JSON config; TypeScript types bypassed via 'as any' or JS callers.","solutions":["Pass forceFullSequences: true or false explicitly","Coerce string flags before calling: forceFullSequences === 'true'","Ensure the options object actually contains the key when constructing from config/JSON"],"exampleFix":"// before\ntranscribe({...options, forceFullSequences: process.env.FULL_SEQ});\n// after\ntranscribe({...options, forceFullSequences: process.env.FULL_SEQ === 'true'});","handlingStrategy":"type-guard","validationCode":"if (typeof forceFullSequences !== 'boolean') throw new Error('forceFullSequences must be a boolean');","typeGuard":"const isBool = (v: unknown): v is boolean => typeof v === 'boolean';","tryCatchPattern":"try {\n  await transcribe(options);\n} catch (e) {\n  if (e instanceof TypeError && e.message.startsWith('forceFullSequences')) {\n    options.forceFullSequences = Boolean(options.forceFullSequences);\n  } else throw e;\n}","preventionTips":["Never pass CLI/env strings directly as boolean options","Use TypeScript strict typing on option objects","Coerce with === 'true' when reading from string sources"],"tags":["validation","typecheck","whisper"],"backgroundTag":"type-mismatch","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}