{"record":{"id":"88b26aa5a354c1c2","repo":"heygen-com/hyperframes","slug":"unknown-argument-arg","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/aws-lambda/scripts/probe-beginframe.ts","lineNumber":92,"sourceCode":"      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}\n\nfunction readLaunchArgs(path: string): string[] {\n  const resolved = resolve(path);\n  const value: unknown = JSON.parse(readFileSync(resolved, \"utf-8\"));\n  if (!Array.isArray(value) || !value.every((item) => typeof item === \"string\")) {\n    throw new Error(`--launch-args-json must contain a JSON string array: ${resolved}`);\n  }\n  return value;\n}\n\nasync function awaitBeforeDeadline<T>(\n  operation: Promise<T>,","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/aws-lambda/scripts/probe-beginframe.ts#L74-L110","documentation":"The probe CLI accepts only --executable-path (paired or equals form) and --launch-args-json (paired or equals form). Any other argument token — unrecognized flags, positional arguments, or flags from a different tool — falls through all branches and triggers this error.","triggerScenarios":"Passing any unrecognized argument such as --help, --url, --port, --headless, or a bare positional argument.","commonSituations":"Trying to use flags from Puppeteer's CLI or another tool; passing a URL or config file positionally; assuming --help is supported (it is not).","solutions":["Remove unrecognized arguments from the command.","Use only --executable-path and --launch-args-json.","Check the script header comment for the exact supported flags."],"exampleFix":"// before\nprobe-beginframe.ts --url=http://localhost:9222\n\n// after\nprobe-beginframe.ts --executable-path=/path/to/chrome","handlingStrategy":"validation","validationCode":"const ACCEPTED = [\n  \"--executable-path\",\n  \"--executable-path=\",\n  \"--launch-args-json\",\n  \"--launch-args-json=\",\n];\nfor (const arg of args) {\n  if (arg.startsWith(\"--\") && !ACCEPTED.some((f) => arg === f || arg.startsWith(f))) {\n    console.error(`Unknown argument: ${arg}. Accepted: --executable-path, --launch-args-json`);\n    process.exit(1);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Review the script header comment for the accepted flag set before use.","Do not pass flags from other tools (Puppeteer CLI, etc.).","Remove positional arguments — this CLI does not accept them."],"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"}