{"record":{"id":"9c0e5321c366a24c","repo":"microsoft/playwright","slug":"playwright-manages-remote-debugging-connection-its-9c0e53","errorCode":null,"errorMessage":"Playwright manages remote debugging connection itself.","messagePattern":"Playwright manages remote debugging connection itself\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/chromium/chromium.ts","lineNumber":371,"sourceCode":"\n  override async defaultArgs(options: types.LaunchOptions, isPersistent: boolean, userDataDir: string) {\n    const chromeArguments = this._innerDefaultArgs(options);\n    chromeArguments.push(`--user-data-dir=${userDataDir}`);\n    chromeArguments.push('--remote-debugging-pipe');\n    if (isPersistent)\n      chromeArguments.push('about:blank');\n    else\n      chromeArguments.push('--no-startup-window');\n    return chromeArguments;\n  }\n\n  private _innerDefaultArgs(options: types.LaunchOptions): string[] {\n    const { args = [] } = options;\n    const userDataDirArg = args.find(arg => arg.startsWith('--user-data-dir'));\n    if (userDataDirArg)\n      throw this._createUserDataDirArgMisuseError('--user-data-dir');\n    if (args.find(arg => arg.startsWith('--remote-debugging-pipe')))\n      throw new Error('Playwright manages remote debugging connection itself.');\n    if (args.find(arg => !arg.startsWith('-')))\n      throw new Error('Arguments can not specify page to be opened');\n    const chromeArguments = [...chromiumSwitches()];\n\n    // See https://issues.chromium.org/issues/40277080\n    chromeArguments.push('--enable-unsafe-swiftshader');\n\n    if (options.headless) {\n      chromeArguments.push('--headless');\n\n      chromeArguments.push(\n          '--hide-scrollbars',\n          '--mute-audio',\n          '--blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4',\n      );\n    }\n    if (options.chromiumSandbox !== true)\n      chromeArguments.push('--no-sandbox');","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/chromium/chromium.ts#L353-L389","documentation":"Thrown in Chromium._innerDefaultArgs when the user-supplied args contain '--remote-debugging-pipe'. Playwright itself drives the browser over a remote-debugging pipe (or websocket) and must own that channel; a user-supplied flag would conflict, so it is rejected.","triggerScenarios":"chromium.launch({ args: ['--remote-debugging-pipe'] }) or persistent context with the same arg.","commonSituations":"Copy-pasting Chrome launch flags from a non-Playwright tutorial. Trying to 'optimize' the connection by adding the pipe flag manually.","solutions":["Remove '--remote-debugging-pipe' from args; Playwright adds the correct transport flag itself.","If you need a specific debugging transport, use the chromium built-in (pipe is default) — do not pass it explicitly.","Use chromium.connectOverCDP if you genuinely need a separate WebSocket debugging endpoint."],"exampleFix":"// before\nawait chromium.launch({ args: ['--remote-debugging-pipe', '--no-sandbox'] });\n// after\nawait chromium.launch({ args: ['--no-sandbox'] });","handlingStrategy":"validation","validationCode":"function sanitizeArgs(args: string[]): string[] {\n  if (args.some(a => a.startsWith('--remote-debugging-pipe')))\n    throw new Error('Do not pass --remote-debugging-pipe; Playwright manages the transport');\n  return args;\n}","typeGuard":"function argsArePlaywrightSafe(args: string[]): boolean {\n  return !args.some(a => a.startsWith('--remote-debugging-pipe'));\n}","tryCatchPattern":null,"preventionTips":["Treat launchOptions.args as Playwright-supplemental flags only; never transport/debugging flags.","Review copied Chrome flags against Playwright's defaultArgs before adding them."],"tags":["launch","chromium","args","cdp"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}