{"record":{"id":"dfae291600156199","repo":"heygen-com/hyperframes","slug":"launch-args-json-requires-a-path","errorCode":null,"errorMessage":"--launch-args-json requires a path","messagePattern":"--launch-args-json requires a path","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/aws-lambda/scripts/probe-beginframe.ts","lineNumber":80,"sourceCode":"    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;\n      continue;\n    }\n    if (arg.startsWith(\"--launch-args-json=\")) {\n      const value = arg.slice(\"--launch-args-json=\".length);\n      if (!value) throw new Error(\"--launch-args-json requires a path\");\n      launchArgs = readLaunchArgs(value);\n      continue;\n    }\n    throw new Error(`Unknown argument: ${arg}`);\n  }\n  return {\n    ...(executablePath ? { executablePath } : {}),\n    ...(launchArgs ? { launchArgs } : {}),\n  };\n}","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/aws-lambda/scripts/probe-beginframe.ts#L62-L98","documentation":"When --launch-args-json 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 args) or starts with --, it throws. The value should be a path to a JSON file containing a string array of Chrome launch arguments.","triggerScenarios":"Passing --launch-args-json as the last argument with no value, or followed immediately by another flag token like --executable-path.","commonSituations":"Forgetting to provide the JSON file path; the file path was accidentally consumed by a preceding flag; copy-paste from an incomplete command.","solutions":["Provide the JSON file path after --launch-args-json: --launch-args-json ./launch-args.json.","Use the equals form: --launch-args-json=./launch-args.json."],"exampleFix":"// before\nprobe-beginframe.ts --launch-args-json\n\n// after\nprobe-beginframe.ts --launch-args-json ./launch-args.json","handlingStrategy":"validation","validationCode":"const i = args.indexOf(\"--launch-args-json\");\nif (i !== -1) {\n  const value = args[i + 1];\n  if (!value || value.startsWith(\"--\")) {\n    console.error(\"--launch-args-json requires a file path. Usage: --launch-args-json ./args.json\");\n    process.exit(1);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide the JSON file path immediately after --launch-args-json.","Use the equals form (--launch-args-json=./args.json) to avoid ambiguity.","Verify the file exists before running the probe."],"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"}