microsoft/playwright · error · Error
Too many arguments. If you need to pass more than 1 argument
Error message
Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.
What it means
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.
Source
Thrown at packages/playwright-core/src/client/jsHandle.ts:137
const serialized = serializeArgument(arg, callback => {
if (!page)
throw new Error('Passing a function is not supported as an argument here');
const name = kFunctionBindingPrefix + createGuid();
exposePromises.push(page._exposeEvaluateCallback(name, callback));
return name;
});
await Promise.all(exposePromises);
return serialized;
}, { internal: true });
}
export function parseResult(value: channels.SerializedValue): any {
return parseSerializedValue(value, undefined);
}
export function assertMaxArguments(count: number, max: number): asserts count {
if (count > max)
throw new Error('Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.');
}
export function assertEvaluateOptions(options: any) {
if (options !== undefined && (typeof options !== 'object' || options === null || Array.isArray(options)))
throw new Error('Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.');
}
View on GitHub (pinned to c8fc3bf8d3)
When it happens
Trigger: Thrown at packages/playwright-core/src/client/jsHandle.ts:137 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12).
Data as JSON: /api/errors/2c146e3e614ed392.
Report an issue: GitHub.