{"record":{"id":"bcaa885eda29ce7f","repo":"iOfficeAI/OfficeCLI","slug":"invalid-render","errorCode":"invalid_render","errorMessage":"Invalid --render value: {renderMode}. Valid: auto, native, html","messagePattern":"Invalid --render value: (.+?)\\. Valid: auto, native, html","errorType":"exception","errorClass":"CliException","httpStatus":null,"severity":"error","filePath":"src/officecli/CommandBuilder.View.cs","lineNumber":81,"sourceCode":"            var maxLines = result.GetValue(maxLinesOpt);\n            var issueType = IssueSubtypes.Validate(result.GetValue(issueTypeOpt));\n            var limit = result.GetValue(limitOpt);\n            var colsStr = result.GetValue(colsOpt);\n            var pageFilter = result.GetValue(pageOpt);\n            var browser = result.GetValue(browserOpt);\n            var outArg = result.GetValue(outOpt);\n            var clipArg = result.GetValue(clipOpt);\n            var screenshotWidth = result.GetValue(screenshotWidthOpt);\n            var screenshotHeight = result.GetValue(screenshotHeightOpt);\n            // --grid has three states: absent → off (0), present with no value\n            // (bare --grid) → auto (-1), present with a value → parse it.\n            var gridResult = result.GetResult(gridOpt);\n            var gridCols = gridResult is null ? 0\n                : gridResult.Tokens.Count == 0 ? -1\n                : ParseGridSpec(gridResult.Tokens[0].Value);\n            var renderMode = (result.GetValue(renderOpt) ?? \"auto\").ToLowerInvariant();\n            if (renderMode is not (\"auto\" or \"native\" or \"html\"))\n                throw new OfficeCli.Core.CliException($\"Invalid --render value: {renderMode}. Valid: auto, native, html\") { Code = \"invalid_render\", ValidValues = [\"auto\", \"native\", \"html\"] };\n            var withPages = result.GetValue(withPagesOpt);\n\n            // pdf mode runs entirely through an exporter plugin (no handler\n            // open, no resident hop — the plugin gets a snapshot of the\n            // source and writes the PDF). Handled before TryResident\n            // because exporter invocation needs the file lock released, and\n            // ExporterInvoker closes the resident itself when present.\n            if (mode.ToLowerInvariant() is \"pdf\")\n            {\n                var pdfPath = outArg ?? Path.ChangeExtension(file.FullName, \"pdf\");\n                var exp = OfficeCli.Core.Plugins.ExporterInvoker.Run(file.FullName, \".pdf\", pdfPath);\n                if (json)\n                {\n                    Console.WriteLine(OutputFormatter.WrapEnvelopeText(exp.OutputPath));\n                }\n                else\n                {\n                    Console.WriteLine(Path.GetFullPath(exp.OutputPath));","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/CommandBuilder.View.cs#L63-L99","documentation":"The --render flag for 'view' screenshot mode accepts exactly auto, native, or html. 'auto' picks native on Windows-with-Word/PowerPoint and html elsewhere; 'native' forces OS-native (errors if unavailable); 'html' forces the browser path. Any other value is rejected with the valid set surfaced.","triggerScenarios":"'officecli view deck.pptx screenshot --render canvas' or any --render value outside {auto, native, html}.","commonSituations":"Typo; guessing a render backend name; passing 'pdf' or 'svg' (those are separate view modes, not render backends).","solutions":["Use --render auto (let it choose), native, or html.","Omit --render entirely — auto is the default."],"exampleFix":"// before\nofficecli view deck.pptx screenshot --render canvas\n// after\nofficecli view deck.pptx screenshot --render html","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> RenderModes = new(StringComparer.OrdinalIgnoreCase) { \"auto\", \"native\", \"html\" };\nif (!RenderModes.Contains(renderMode))\n    throw new ArgumentException($\"--render must be one of: {string.Join(\", \", RenderModes)}.\");","typeGuard":"static bool IsValidRenderMode(string? r) =>\n    r is null || r.ToLowerInvariant() is \"auto\" or \"native\" or \"html\";","tryCatchPattern":null,"preventionTips":["--render is one of {auto, native, html}; auto is the safe default.","Do not conflate render backend names with view modes (pdf/svg are modes)."],"tags":["view","render","invalid-value","screenshot"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}