Skip to content

Commit 1d56a35

Browse files
claudeaceaeclaude
andcommitted
docs: enhance troubleshooting guide with detailed solutions
- Expand "Target closed" error section with 5 common causes and solutions - Add new section for configuration file issues with JSON validation tips - Improve debugging section with platform-specific examples (Windows/Unix) - Add details about what debug logs contain - Include --isolated flag example for profile conflicts - Add example of valid MCP configuration JSON These improvements help users: 1. Self-diagnose common connection and startup errors 2. Validate their configuration files correctly 3. Enable debugging on different operating systems 4. Understand what information logs provide 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 28b8ff8 commit 1d56a35

1 file changed

Lines changed: 55 additions & 5 deletions

File tree

docs/troubleshooting.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,24 @@
1111

1212
## Debugging
1313

14+
When reporting issues or diagnosing problems, enable debug logging to capture detailed information.
15+
16+
### Standalone debugging
17+
1418
Start the MCP server with debugging enabled and a log file:
1519

16-
- `DEBUG=* npx chrome-devtools-mcp@latest --log-file=/path/to/chrome-devtools-mcp.log`
20+
```sh
21+
DEBUG=* npx chrome-devtools-mcp@latest --log-file=/path/to/chrome-devtools-mcp.log
22+
```
23+
24+
On Windows (PowerShell):
25+
```powershell
26+
$env:DEBUG="*"; npx chrome-devtools-mcp@latest --log-file=C:\path\to\chrome-devtools-mcp.log
27+
```
28+
29+
### Debugging with an MCP client
1730

18-
Using `.mcp.json` to debug while using a client:
31+
Configure your MCP client to enable debug logging:
1932

2033
```json
2134
{
@@ -24,6 +37,7 @@ Using `.mcp.json` to debug while using a client:
2437
"type": "stdio",
2538
"command": "npx",
2639
"args": [
40+
"-y",
2741
"chrome-devtools-mcp@latest",
2842
"--log-file",
2943
"/path/to/chrome-devtools-mcp.log"
@@ -36,6 +50,12 @@ Using `.mcp.json` to debug while using a client:
3650
}
3751
```
3852

53+
The log file will contain detailed information about:
54+
- Server startup and initialization
55+
- Tool invocations and parameters
56+
- Chrome DevTools Protocol (CDP) messages
57+
- Error stack traces
58+
3959
## Specific problems
4060

4161
### `Error [ERR_MODULE_NOT_FOUND]: Cannot find module ...`
@@ -51,9 +71,39 @@ npm cache clean --force
5171

5272
### `Target closed` error
5373

54-
This indicates that the browser could not be started. Make sure that no Chrome
55-
instances are running or close them. Make sure you have the latest stable Chrome
56-
installed and that [your system is able to run Chrome](https://support.google.com/chrome/a/answer/7100626?hl=en).
74+
This indicates that the browser could not be started or the connection was lost. Common causes and solutions:
75+
76+
1. **Chrome already running**: Close all Chrome instances and try again
77+
2. **Chrome not installed**: Make sure you have the latest stable Chrome installed
78+
3. **System requirements**: Verify [your system is able to run Chrome](https://support.google.com/chrome/a/answer/7100626?hl=en)
79+
4. **Port conflict**: If using `--browser-url`, ensure the debugging port (e.g., 9222) is not already in use
80+
5. **User data directory locked**: Try using `--isolated` flag to create a temporary profile
81+
82+
Example with isolated mode:
83+
```sh
84+
npx -y chrome-devtools-mcp@latest --isolated
85+
```
86+
87+
### Configuration file not being recognized
88+
89+
If your MCP client is not loading the chrome-devtools-mcp server, check:
90+
91+
1. **File location**: Ensure the configuration file is in the correct location for your MCP client
92+
2. **JSON syntax**: Validate your JSON using a linter or online validator
93+
3. **Quotes**: Use double quotes for all JSON strings, not single quotes
94+
4. **Trailing commas**: Remove any trailing commas in JSON objects or arrays
95+
96+
Example of valid configuration:
97+
```json
98+
{
99+
"mcpServers": {
100+
"chrome-devtools": {
101+
"command": "npx",
102+
"args": ["-y", "chrome-devtools-mcp@latest"]
103+
}
104+
}
105+
}
106+
```
57107

58108
### Remote debugging between virtual machine (VM) and host fails
59109

0 commit comments

Comments
 (0)