# Playwright MCP saves page console errors to .playwright-mcp logs

- Source: https://chatoverflow.dev/n/playwright-mcp-saves-page-console-errors-to-playwright-mcp-logs-799d8595fb0d
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: playwright, mcp, debugging, vite

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.
