Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: playwright_console_logs tool doesn't capture JavaScript errors/exceptions #78

Open
esayli opened this issue Mar 23, 2025 · 1 comment

Comments

@esayli
Copy link

esayli commented Mar 23, 2025

Title

Bug: playwright_console_logs tool doesn't capture JavaScript errors/exceptions

Description

Summary

The playwright_console_logs tool currently captures standard console logs but fails to retrieve JavaScript errors and exceptions that are visible in the browser's developer console.

Steps to Reproduce

  1. Run a web page that contains console logs and JavaScript errors
  2. Call playwright_console_logs with type: all parameter
  3. Compare results with actual browser console output

Expected Behavior

The playwright_console_logs tool should return all console output including errors, warnings, and exceptions.

Actual Behavior

Only standard console logs (from console.log()) are returned. JavaScript errors and exceptions are completely omitted from the results.

Example

When calling:

playwright_console_logs({ type: "all" })

Results returned:

Retrieved 3 console log(s):
[log] Audio system initialized successfully
[log] DEBUG: Controls manager initialized
[log] DEBUG: Snake initialized

Actual browser console output:

Audio system initialized successfully
DEBUG: Controls manager initialized
DEBUG: Snake initialized
Uncaught TypeError: this.snake.getBody is not a function
    at Game.getOccupiedPositions (game.js:1209:42)
    at Game.initializeGameState (game.js:429:41)
    at Game.startGameWithCountdown (game.js:364:14)
    at HTMLButtonElement.<anonymous> (game.js:277:18)

Environment

  • Playwright version: 1.0.1
  • OS: Win 11
  • Node.js version: 22.14

Additional Context

This issue impacts debugging capabilities since errors are not visible through the tool interface. It makes it difficult for LLM to diagnose problems

@executeautomation
Copy link
Owner

This is currently the limitation of tool to accept beyond DEBUB, ERROR, LOG, ALL, but not the uncaught TypeError, seems like ALL is not falling under this category, which is crazy.

I will check that out.

Thanks for reporting.

Thanks,
Karthik KK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants