-
Notifications
You must be signed in to change notification settings - Fork 864
Open
Description
Version
System:
OS: Windows 11 / macOS 15.2
Node: v20.x
Browsers:
Chrome: 131.x
npmPackages:
@midscene/web: 1.0.4
playwright-core: 1.49.x
Details
When using Midscene with Playwright (not Puppeteer), the forceChromeSelectRendering function causes repeated console errors on every page load:
Midscene - Failed to add base-select appearance style: Error: Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.
at assertMaxArguments (playwright-core/lib/client/jsHandle.js:101:11)
at Page.evaluate (playwright-core/lib/client/page.js:395:44)
at injectStyle (@midscene/web/dist/es/puppeteer/base-page.mjs:505:24)
Root cause: In base-page.ts line 748-756, the code passes multiple arguments to page.evaluate() using Puppeteer-style syntax:
await (page as PuppeteerPage & PlaywrightPage).evaluate(
(id, content) => { ... },
styleId,
styleContent,
);Puppeteer allows multiple arguments after the function, but Playwright requires wrapping them in an object.
Note: The BasePage.evaluate wrapper method (lines 80-99) handles single-arg correctly, but forceChromeSelectRendering bypasses it and calls directly on the page.
Reproduce link
Reproduce Steps
- Use Midscene with Playwright (not Puppeteer)
- Navigate to any page with
forceChromeSelectRenderingenabled - Observe console error: "Too many arguments..."
- Error repeats on every page load event
Reactions are currently unavailable