{"record":{"id":"2c146e3e614ed392","repo":"microsoft/playwright","slug":"too-many-arguments-if-you-need-to-pass-more-than","errorCode":null,"errorMessage":"Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.","messagePattern":"Too many arguments\\. If you need to pass more than 1 argument to the function wrap them in an object\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/client/jsHandle.ts","lineNumber":137,"sourceCode":"    const serialized = serializeArgument(arg, callback => {\n      if (!page)\n        throw new Error('Passing a function is not supported as an argument here');\n      const name = kFunctionBindingPrefix + createGuid();\n      exposePromises.push(page._exposeEvaluateCallback(name, callback));\n      return name;\n    });\n    await Promise.all(exposePromises);\n    return serialized;\n  }, { internal: true });\n}\n\nexport function parseResult(value: channels.SerializedValue): any {\n  return parseSerializedValue(value, undefined);\n}\n\nexport function assertMaxArguments(count: number, max: number): asserts count {\n  if (count > max)\n    throw new Error('Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.');\n}\n\nexport function assertEvaluateOptions(options: any) {\n  if (options !== undefined && (typeof options !== 'object' || options === null || Array.isArray(options)))\n    throw new Error('Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.');\n}\n","sourceCodeStart":119,"sourceCodeEnd":144,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/client/jsHandle.ts#L119-L144","documentation":"Error \"Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/client/jsHandle.ts:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}