{"record":{"id":"4e1716da6145a358","repo":"puppeteer/puppeteer","slug":"no-browser-arg-provided","errorCode":null,"errorMessage":"No browser arg provided","messagePattern":"No browser arg provided","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/browsers/src/CLI.ts","lineNumber":623,"sourceCode":"      : this.#pinnedBrowsers\n        ? 'pinned'\n        : 'latest';\n  }\n\n  #resolvePinnedBrowserIfNeeded(buildId: string, browserName: Browser): string {\n    if (buildId === 'pinned') {\n      const options = this.#pinnedBrowsers?.[browserName];\n      if (!options || !options.buildId) {\n        throw new Error(`No pinned version found for ${browserName}`);\n      }\n      return options.buildId;\n    }\n    return buildId;\n  }\n\n  async #install(args: InstallArgs) {\n    if (!args.browser) {\n      throw new Error(`No browser arg provided`);\n    }\n    if (!args.platform) {\n      throw new Error(`Could not resolve the current platform`);\n    }\n    args.browser.buildId = this.#resolvePinnedBrowserIfNeeded(\n      args.browser.buildId,\n      args.browser.name,\n    );\n    const originalBuildId = args.browser.buildId;\n    args.browser.buildId = await resolveBuildId(\n      args.browser.name,\n      args.platform,\n      args.browser.buildId,\n    );\n    await install({\n      browser: args.browser.name,\n      buildId: args.browser.buildId,\n      platform: args.platform,","sourceCodeStart":605,"sourceCodeEnd":641,"githubUrl":"https://github.com/puppeteer/puppeteer/blob/d484e21c17f6023826fefdcdeeb553e04a7aaed8/packages/browsers/src/CLI.ts#L605-L641","documentation":"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.","triggerScenarios":"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.","commonSituations":"Custom wrappers that construct `InstallArgs` manually and forget the `browser` field, or a regression in the CLI routing logic.","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."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"function hasBrowserArg(args: { browser?: { name?: string; buildId?: string } }): args is { browser: { name: string; buildId: string } } {\n  return !!args.browser && !!args.browser.name && !!args.browser.buildId;\n}","typeGuard":"function isInstallBrowser(v: unknown): v is { name: string; buildId: string } {\n  return typeof v === 'object' && v !== null && typeof (v as any).name === 'string' && typeof (v as any).buildId === 'string';\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["cli","install","defensive-guard","internal"],"backgroundTag":null,"analyzedSha":"d484e21c17f6023826fefdcdeeb553e04a7aaed8","analyzedAt":"2026-08-12T06:33:19.665Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}