{"record":{"id":"fe22ca4e49969c0a","repo":"charmbracelet/vhs","slug":"expected-file-path-after-output","errorCode":null,"errorMessage":"Expected file path after output","messagePattern":"Expected file path after output","errorType":"validation","errorClass":"parser.Error","httpStatus":null,"severity":"error","filePath":"parser/parser.go","lineNumber":421,"sourceCode":"// A keypress command takes an optional typing speed and optional count.\n//\n//\tKey[@<time>] [count]\nfunc (p *Parser) parseKeypress(ct token.Type) Command {\n\tcmd := Command{Type: CommandType(ct)}\n\tcmd.Options = p.parseSpeed()\n\tcmd.Args = p.parseRepeat()\n\treturn cmd\n}\n\n// 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","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/charmbracelet/vhs/blob/c073383b5de0b1f57bf514113029c306bc986539/parser/parser.go#L403-L439","documentation":"Fires in parseOutput when the token following the Output command is not a STRING, i.e. no file path (or folder path) was supplied for where the recording should be written. The command is returned with no destination and the error is recorded against the current token.","triggerScenarios":"Thrown at parser/parser.go:421 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a destination after Output, e.g. Output out.png or Output frames/","Quote the path if it contains characters the lexer would tokenize differently","Remove the Output line if no output file is wanted"],"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"}