{"record":{"id":"46b9e15983e5f69e","repo":"remotion-dev/remotion","slug":"outputpath-must-be-a-string","errorCode":null,"errorMessage":"outputPath must be a string.","messagePattern":"outputPath must be a string\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":597,"sourceCode":"\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst forceFullSequences = input.forceFullSequences ?? false;\n\t\t\t\t\t\tconst doSample = input.doSample ?? false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof forceFullSequences !== 'boolean' ||\n\t\t\t\t\t\t\ttypeof doSample !== 'boolean'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t'forceFullSequences and doSample must be booleans.',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst src = staticFile(assetPath);\n\t\t\t\t\t\tconst displayName = assetPath.split('/').at(-1) ?? assetPath;\n\t\t\t\t\t\tconst outputPath =\n\t\t\t\t\t\t\tinput.outputPath ?? getDefaultCaptionOutputName(src, displayName);\n\t\t\t\t\t\tif (typeof outputPath !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('outputPath must be a string.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst outputError = validateCaptionOutputName(outputPath);\n\t\t\t\t\t\tif (outputError !== null) {\n\t\t\t\t\t\t\tthrow new Error(outputError);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst jobId = addCaptionJob({\n\t\t\t\t\t\t\taudioStreamIndex: null,\n\t\t\t\t\t\t\tchunkLengthInSeconds,\n\t\t\t\t\t\t\tdisplayName,\n\t\t\t\t\t\t\tdoSample,\n\t\t\t\t\t\t\tforceFullSequences,\n\t\t\t\t\t\t\tlanguage: model.multilingual ? language : null,\n\t\t\t\t\t\t\tmodel: model.name,\n\t\t\t\t\t\t\tnoRepeatNgramSize,\n\t\t\t\t\t\t\toutName: outputPath,\n\t\t\t\t\t\t\trepetitionPenalty,","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L579-L615","documentation":"The optional `outputPath` input, if supplied, must be a string. When omitted, the tool derives a default caption file name via getDefaultCaptionOutputName(). Non-string outputPath values are rejected before the output name is validated.","triggerScenarios":"Passing input.outputPath as an object, array, number, or boolean instead of a string file name/path.","commonSituations":"Passing a filesystem Path object from another tool; accidentally nesting the value (e.g. { path: \"out.srt\" }); form data serializing as non-string.","solutions":["Pass outputPath as a plain string (e.g. \"captions.srt\")","Omit outputPath to let the tool generate a default name","Stringify/normalize the value before calling"],"exampleFix":"// before\n{ \"outputPath\": { \"path\": \"out.srt\" } }\n// after\n{ \"outputPath\": \"out.srt\" } // or omit entirely","handlingStrategy":"type-guard","validationCode":"if (input.outputPath !== undefined && typeof input.outputPath !== 'string') {\n  throw new Error('outputPath must be a string');\n}","typeGuard":"const isOutputPath = (v: unknown): v is string => typeof v === 'string';","tryCatchPattern":"try {\n  await callWhisperTool({ outputPath });\n} catch (err) {\n  if (err instanceof Error && err.message === 'outputPath must be a string.') {\n    await callWhisperTool({}); // let the tool derive a default name\n  }\n}","preventionTips":["Pass plain string paths, not Path objects or nested objects","Omit outputPath to accept the auto-generated caption file name","Stringify user input before sending"],"tags":["validation","captions","type-error"],"backgroundTag":"type-mismatch","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}