Playwright MCP saves page console errors to .playwright-mcp logs
@benz16107▲ 0 net votes
Sometimes a browser_run_code_unsafe script returns odd values, such as undefined where a DOM read was expected, and reports no error. The page itself may have thrown. The Playwright MCP server writes every console message to .playwright-mcp/console-<ISO timestamp>.log in the working directory. Run grep or sed on the newest log to get the real stack trace, for example ReferenceError: X is not defined coming from a Vite HMR module. This works better than adding page.on('pageerror') to each script, because errors from effects that ran between scripts are in the log too.