heygen-com/hyperframes · error · Error

Unknown argument: ${arg}

Error message

Unknown argument: ${arg}

What it means

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.

Source

Thrown at packages/aws-lambda/scripts/probe-beginframe.ts:92

      executablePath = resolve(value);
      continue;
    }
    if (arg === "--launch-args-json") {
      const value = args[i + 1];
      if (!value || value.startsWith("--")) {
        throw new Error("--launch-args-json requires a path");
      }
      launchArgs = readLaunchArgs(value);
      i += 1;
      continue;
    }
    if (arg.startsWith("--launch-args-json=")) {
      const value = arg.slice("--launch-args-json=".length);
      if (!value) throw new Error("--launch-args-json requires a path");
      launchArgs = readLaunchArgs(value);
      continue;
    }
    throw new Error(`Unknown argument: ${arg}`);
  }
  return {
    ...(executablePath ? { executablePath } : {}),
    ...(launchArgs ? { launchArgs } : {}),
  };
}

function readLaunchArgs(path: string): string[] {
  const resolved = resolve(path);
  const value: unknown = JSON.parse(readFileSync(resolved, "utf-8"));
  if (!Array.isArray(value) || !value.every((item) => typeof item === "string")) {
    throw new Error(`--launch-args-json must contain a JSON string array: ${resolved}`);
  }
  return value;
}

async function awaitBeforeDeadline<T>(
  operation: Promise<T>,

View on GitHub (pinned to c2996c8626)

Solutions

  1. Remove unrecognized arguments from the command.
  2. Use only --executable-path and --launch-args-json.
  3. Check the script header comment for the exact supported flags.

Example fix

// before
probe-beginframe.ts --url=http://localhost:9222

// after
probe-beginframe.ts --executable-path=/path/to/chrome
Defensive patterns

Strategy: validation

Validate before calling

const ACCEPTED = [
  "--executable-path",
  "--executable-path=",
  "--launch-args-json",
  "--launch-args-json=",
];
for (const arg of args) {
  if (arg.startsWith("--") && !ACCEPTED.some((f) => arg === f || arg.startsWith(f))) {
    console.error(`Unknown argument: ${arg}. Accepted: --executable-path, --launch-args-json`);
    process.exit(1);
  }
}

Prevention

When it happens

Trigger: Passing any unrecognized argument such as --help, --url, --port, --headless, or a bare positional argument.

Common situations: 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).

Related errors


AI-assisted analysis of heygen-com/hyperframes@c2996c8626 (2026-08-12). Data as JSON: /api/errors/88b26aa5a354c1c2. Report an issue: GitHub.