{"record":{"id":"2a3ad50b309a7674","repo":"charmbracelet/vhs","slug":"expected-folder-with-trailing-slash","errorCode":null,"errorMessage":"Expected folder with trailing slash","messagePattern":"Expected folder with trailing slash","errorType":"validation","errorClass":"parser.Error","httpStatus":null,"severity":"error","filePath":"parser/parser.go","lineNumber":431,"sourceCode":"// parseOutput parses an output command.\n// An output command takes a file path to which to output.\n//\n//\tOutput <path>\nfunc (p *Parser) parseOutput() Command {\n\tcmd := Command{Type: token.OUTPUT}\n\n\tif p.peek.Type != token.STRING {\n\t\tp.errors = append(p.errors, NewError(p.cur, \"Expected file path after output\"))\n\t\treturn cmd\n\t}\n\n\text := filepath.Ext(p.peek.Literal)\n\tif ext != \"\" {\n\t\tcmd.Options = ext\n\t} else {\n\t\tcmd.Options = \".png\"\n\t\tif !strings.HasSuffix(p.peek.Literal, \"/\") {\n\t\t\tp.errors = append(p.errors, NewError(p.peek, \"Expected folder with trailing slash\"))\n\t\t}\n\t}\n\n\tcmd.Args = p.peek.Literal\n\tp.nextToken()\n\treturn cmd\n}\n\n// parseSet parses a set command.\n// A set command takes a setting name and a value.\n//\n//\tSet <setting> <value>\nfunc (p *Parser) parseSet() Command {\n\tcmd := Command{Type: token.SET}\n\n\tif token.IsSetting(p.peek.Type) {\n\t\tcmd.Options = p.peek.Literal\n\t} else {","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/charmbracelet/vhs/blob/c073383b5de0b1f57bf514113029c306bc986539/parser/parser.go#L413-L449","documentation":"Fires in parseOutput when the Output argument has no file extension, so it is treated as a directory (defaulting output format to .png), but the path does not end with '/'. The parser cannot tell whether the target is a folder, so it flags the missing trailing slash.","triggerScenarios":"Thrown at parser/parser.go:431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Append a trailing slash to the folder path, e.g. Output frames/","Add a file extension if a file was intended, e.g. Output out.png or Output out.webm"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c073383b5de0b1f57bf514113029c306bc986539","analyzedAt":"2026-09-02T01:53:05.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}