{"record":{"id":"ed3164e73fa1dc43","repo":"heygen-com/hyperframes","slug":"executable-path-requires-a-path","errorCode":null,"errorMessage":"--executable-path requires a path","messagePattern":"--executable-path requires a path","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/aws-lambda/scripts/probe-beginframe.ts","lineNumber":65,"sourceCode":"export interface ProbeOptions {\n  executablePath?: string;\n  /** Exact launch arguments to probe instead of the standalone default profile. */\n  launchArgs?: string[];\n  /** Test override for the renderer/CDP operation deadline. */\n  timeoutMs?: number;\n}\n\n// The CLI accepts paired and equals forms for two independent path options.\n// fallow-ignore-next-line complexity\nexport function parseProbeArgs(args: string[]): ProbeOptions {\n  let executablePath: string | undefined;\n  let launchArgs: string[] | undefined;\n  for (let i = 0; i < args.length; i += 1) {\n    const arg = args[i];\n    if (arg === \"--executable-path\") {\n      const value = args[i + 1];\n      if (!value || value.startsWith(\"--\")) {\n        throw new Error(\"--executable-path requires a path\");\n      }\n      executablePath = resolve(value);\n      i += 1;\n      continue;\n    }\n    if (arg.startsWith(\"--executable-path=\")) {\n      const value = arg.slice(\"--executable-path=\".length);\n      if (!value) throw new Error(\"--executable-path requires a path\");\n      executablePath = resolve(value);\n      continue;\n    }\n    if (arg === \"--launch-args-json\") {\n      const value = args[i + 1];\n      if (!value || value.startsWith(\"--\")) {\n        throw new Error(\"--launch-args-json requires a path\");\n      }\n      launchArgs = readLaunchArgs(value);\n      i += 1;","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/aws-lambda/scripts/probe-beginframe.ts#L47-L83","documentation":"When --executable-path is passed as a separate token (space-separated paired form), the parser looks at the next argument as the value. If the next arg is missing (end of the args array) or starts with -- (looks like another flag), it throws. The value must be a filesystem path to a Chromium executable.","triggerScenarios":"Passing --executable-path as the last argument with no value following it, or followed immediately by another flag like --executable-path --launch-args-json=args.json where the parser sees --launch-args-json as the value and rejects it.","commonSituations":"Forgetting to provide the path; shell variable that expanded to empty and was consumed; copy-paste error leaving the path off the command.","solutions":["Provide the path after --executable-path: --executable-path /path/to/chrome.","Use the equals form instead: --executable-path=/path/to/chrome.","Ensure no shell variable expands to empty before the path token."],"exampleFix":"// before\n--executable-path --launch-args-json=args.json\n\n// after\n--executable-path /usr/bin/chrome-headless-shell --launch-args-json=args.json","handlingStrategy":"validation","validationCode":"const i = args.indexOf(\"--executable-path\");\nif (i !== -1) {\n  const value = args[i + 1];\n  if (!value || value.startsWith(\"--\")) {\n    console.error(\"--executable-path requires a path argument. Usage: --executable-path /path/to/chrome\");\n    process.exit(1);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide the path token immediately after --executable-path.","Use the equals form (--executable-path=/path) to avoid ambiguity.","Quote paths containing spaces."],"tags":["cli","argument-validation","probe"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}