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

Failed to initialize Stagehand: Cannot create proxy with a non-object as target or handler (Local run on MacOS) #34

Open
onlatency opened this issue Mar 19, 2025 · 3 comments

Comments

@onlatency
Copy link

onlatency commented Mar 19, 2025

Running fully local, without API keys. Testing with Claude Desktop.
This is MacOS, so no /downloads possible. Looks like that is the issue, but I am not knowledgeable on this.

Claude config:

"stagehand": {
      "command": "node",
      "args": ["/Users/localuser/CODE/Browser-Builds/Stagehand/mcp-server-browserbase/stagehand/dist/index.js"],
      "env": {
        "DEBUG": "true"
      }
    }

Error at Claude Desktop:

{
  `url`: `https://google.com`
}
Failed to initialize Stagehand: Cannot create proxy with a non-object as target or handler
Operation logs:`

Logs:

2025-03-19T01:47:38.804Z [stagehand] [info] Message from client: {"method":"tools/call","params":{"name":"stagehand_navigate","arguments":{"url":"https://google.com"}},"jsonrpc":"2.0","id":41}
[2025-03-19T01:47:38.805Z] [DEBUG] REQUEST: {
  "timestamp": "2025-03-19T01:47:38.805Z",
  "type": "CallTool",
  "params": {
    "name": "stagehand_navigate",
    "arguments": {
      "url": "https://google.com"
    }
  }
}
[2025-03-19T01:47:38.807Z] [DEBUG] launching local browser
Error in init: Error: ENOENT: no such file or directory, mkdir '/downloads'
    at Object.mkdirSync (node:fs:1361:26)
    at /Users/localuser/CODE/Browser-Builds/Stagehand/mcp-server-browserbase/stagehand/node_modules/@browserbasehq/stagehand/dist/index.js:6037:27
    at Generator.next (<anonymous>)
    at /Users/localuser/CODE/Browser-Builds/Stagehand/mcp-server-browserbase/stagehand/node_modules/@browserbasehq/stagehand/dist/index.js:76:61
    at new Promise (<anonymous>)
    at __async (/Users/localuser/CODE/Browser-Builds/Stagehand/mcp-server-browserbase/stagehand/node_modules/@browserbasehq/stagehand/dist/index.js:60:10)
    at getBrowser (/Users/localuser/CODE/Browser-Builds/Stagehand/mcp-server-browserbase/stagehand/node_modules/@browserbasehq/stagehand/dist/index.js:5867:10)
    at Stagehand.<anonymous> (/Users/localuser/CODE/Browser-Builds/Stagehand/mcp-server-browserbase/stagehand/node_modules/@browserbasehq/stagehand/dist/index.js:6261:84)
    at Generator.next (<anonymous>)
    at /Users/localuser/CODE/Browser-Builds/Stagehand/mcp-server-browserbase/stagehand/node_modules/@browserbasehq/stagehand/dist/index.js:76:61 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'mkdir',
  path: '/downloads'
}
[2025-03-19T01:47:38.810Z] [DEBUG] RESPONSE: {
  "timestamp": "2025-03-19T01:47:38.810Z",
  "type": "CallTool",
  "response": {
    "content": [
      {
        "type": "text",
        "text": "Failed to initialize Stagehand: Cannot create proxy with a non-object as target or handler"
      },
      {
        "type": "text",
        "text": "Operation logs:\n"
      }
    ],
    "isError": true
  }
}
@gench
Copy link

gench commented Mar 24, 2025

same error on MacOS without any API keys

@arjunmagun
Copy link

@onlatency did you find any fix for the error?

@ericpgreen2
Copy link

Same error. In my case, I've tried to add the MCP server to Cursor, and I have included BrowserBase & OpenAI API keys.

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

4 participants