Content-Length: 250353 | pFad | https://github.com/browserbase/mcp-server-browserbase/issues/56

99 Stagehand initialization error: Cannot create proxy with a non-object as target or handler, and uninitialized page object · Issue #56 · browserbase/mcp-server-browserbase · GitHub
Skip to content

Stagehand initialization error: Cannot create proxy with a non-object as target or handler, and uninitialized page object #56

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

Open
djb4ai opened this issue May 3, 2025 · 3 comments · May be fixed by #57
Assignees

Comments

@djb4ai
Copy link

djb4ai commented May 3, 2025

Issue Description

When attempting to use Stagehand MCP with a local Chrome instance (CDP on port 9222), I encountered the following errors:

  • Cannot create proxy with a non-object as target or handler.
    • You seem to be calling page on a page in an uninitialized Stagehand object. Ensure you are running await stagehand.init() on the Stagehand object before referencing the page object.

Steps to Reproduce

  1. Start Chrome with remote debugging enabled: --remote-debugging-port=9222
    1. Start the Stagehand MCP server with the correct LOCAL_CDP_URL.
    1. Attempt to use browser automation via MCP.

Solution

The issue was resolved by ensuring that await stagehand.init() is called before any reference to the page object. In my case, the initialization was either missing or not awaited properly, causing the errors above. After adding and properly awaiting stagehand.init(), the errors were resolved and browser automation worked as expected.

Suggestion

Consider adding clearer error messages or documentation to help users ensure proper initialization order, especially when using Stagehand in local mode.


Thank you for your work on this project!

@Kylejeong2
Copy link
Contributor

Hey @djb4ai, the point of having that try catch block is to check if the session was properly created. Your PR basically voids the try catch checker. Would love to hear more of your thoughts on why this is needed.

@cotarelorodrigo
Copy link

cotarelorodrigo commented May 16, 2025

I have the same issue. I want to run locally to capture the traffic using burp suite.

Any idea how to achieve this @Kylejeong2 ?

Its possible to use firefox with LOCAL_CDP_URL?

@Jufralice
Copy link

Hello,

the fix for this issue is described here:
#44 (comment)

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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/browserbase/mcp-server-browserbase/issues/56

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy