puppeteer/puppeteer · error
No browser arg provided
Error message
No browser arg provided
What it means
Thrown by `#install` as a defensive guard when `args.browser` is falsy. Under normal yargs flow the browser positional is required (or, in pinned mode, an absent browser triggers the all-pinned install path instead). This error therefore signals an unexpected internal or programmatic invocation of `#install` without a browser.
Source
Thrown at packages/browsers/src/CLI.ts:623
: this.#pinnedBrowsers
? 'pinned'
: 'latest';
}
#resolvePinnedBrowserIfNeeded(buildId: string, browserName: Browser): string {
if (buildId === 'pinned') {
const options = this.#pinnedBrowsers?.[browserName];
if (!options || !options.buildId) {
throw new Error(`No pinned version found for ${browserName}`);
}
return options.buildId;
}
return buildId;
}
async #install(args: InstallArgs) {
if (!args.browser) {
throw new Error(`No browser arg provided`);
}
if (!args.platform) {
throw new Error(`Could not resolve the current platform`);
}
args.browser.buildId = this.#resolvePinnedBrowserIfNeeded(
args.browser.buildId,
args.browser.name,
);
const originalBuildId = args.browser.buildId;
args.browser.buildId = await resolveBuildId(
args.browser.name,
args.platform,
args.browser.buildId,
);
await install({
browser: args.browser.name,
buildId: args.browser.buildId,
platform: args.platform,View on GitHub (pinned to d484e21c17)
Solutions
- Always pass a `browser: { name, buildId }` object when invoking the install flow programmatically.
- If using the CLI, ensure the browser positional argument is supplied (e.g. `install chrome`).
- In pinned mode, let the all-pinned path run by omitting the browser rather than calling install for a specific one.
Defensive patterns
Strategy: type-guard
Validate before calling
function hasBrowserArg(args: { browser?: { name?: string; buildId?: string } }): args is { browser: { name: string; buildId: string } } {
return !!args.browser && !!args.browser.name && !!args.browser.buildId;
} Type guard
function isInstallBrowser(v: unknown): v is { name: string; buildId: string } {
return typeof v === 'object' && v !== null && typeof (v as any).name === 'string' && typeof (v as any).buildId === 'string';
} Prevention
- Always populate args.browser before invoking the install flow.
- In pinned mode, rely on the all-pinned path rather than calling install per-browser without a browser field.
When it happens
Trigger: Direct programmatic reach-through that calls `#install` (private) with an args object missing `browser`, or an edge case where pinned-mode branching fails to route correctly. In standard CLI usage this is effectively unreachable because yargs enforces the positional.
Common situations: Custom wrappers that construct `InstallArgs` manually and forget the `browser` field, or a regression in the CLI routing logic.
Related errors
- Could not resolve the current platform
- Provider is required for installation
- Unsupported browser '${browser.name}'
- Unsupported platform '${platform}'
- Failed to download bisect-builds.py: ${response.statusText}
AI-assisted analysis of puppeteer/puppeteer@d484e21c17 (2026-08-12).
Data as JSON: /api/errors/4e1716da6145a358.
Report an issue: GitHub.