Connection issues
”No connected browsers detected”
The Playwriter extension is not active on any tabs. Solution:- Click the Playwriter extension icon on any tab
- The icon turns green when connected
- Try your command again
”Warning: Extension not connected”
The extension lost connection to the relay server. Solution:-
Restart Chrome:
- Click the extension icon on a tab
- Retry your command
”Error: Cannot connect to relay server”
The relay server failed to start or crashed. Solution:-
Check if port 19988 is in use:
-
Kill any process on port 19988:
-
Check relay server logs:
- Read the log file to understand the issue
Session issues
”Error: -s/—session is required”
You forgot to specify a session ID. Solution: Create a session first:Session state not persisting
You’re using different session IDs for related commands. Solution: Always use the same session ID (-s) for commands that should share state:
“Session not found” error
The session was deleted or the relay server restarted. Solution: Create a new session:Connection reset needed
The browser connection became stale. Solution:state.
Execution errors
Timeout errors
The code took longer than the timeout (default 10 seconds). Solution: Increase the timeout:“Selector not found” errors
The element doesn’t exist or the page isn’t ready. Solution:-
Take a snapshot to see what’s actually on the page:
-
Wait for the page to load:
- Use the correct locator from the snapshot output
”Page is closed” error
The page was closed by the user or another script. Solution: Check if the page is closed before using it:Syntax errors in JavaScript
Bash interpreted special characters in your code. Solution: Always use single quotes for-e:
Browser and page issues
All pages return “about:blank”
Chrome bug inchrome.debugger API.
Solution:
Restart Chrome:
Browser switches to light mode on connect
Known Playwright issue. Solution: No fix yet. This is a Playwright limitation.Multiple browsers detected
You have multiple Chrome profiles or browsers with Playwriter enabled. Solution: Specify which browser to use:playwriter session new without --browser.
Logging and debugging
View relay server logs
The relay server logs contain extension, MCP, and WebSocket server logs.Debug page state
Use these commands to understand what’s happening:Extension not updating
After updating the extension, Chrome may cache the old version. Solution:- Open
chrome://extensions/ - Click the reload button on the Playwriter extension
- Retry your command
Remote access issues
”Authentication token is required”
You’re trying to bind to a public host without a token. Solution: Provide a token when using0.0.0.0:
Connection refused from remote machine
The relay server is only listening on localhost. Solution: Start the server with a public host:Common mistakes
Not verifying actions succeeded
Always check page state after important actions. Solution: Use the observe → act → observe loop:Using stale locators
Locators from old snapshots can become invalid after page updates. Solution: Always take a fresh snapshot before clicking:Not cleaning up listeners
Event listeners leak across execute calls. Solution: Remove listeners when done:Getting help
If you encounter a bug:-
Check the relay server logs:
-
Check the CDP log for protocol-level issues:
-
Create a GitHub issue:
- Playwriter version (
playwriter --version) - Chrome version
- Operating system
- Minimal reproduction steps
- Relevant log excerpts