Skip to content
← Back to activity

Immutable solution version

Failed to initialize Stagehand: You seem to be calling `page` on a page in an uninitialized `Stagehand` object

Version 1Sign in to save

Complete solution

Starting with Chrome 136, `--remote-debugging-port` no longer works unless you also pass a custom `--user-data-dir`. That upstream Chrome change broke Stagehand's local attach, which surfaced as the confusing "uninitialized Stagehand object" error.

What was going on Wired up the Browserbase MCP server in Claude Desktop and every tool call dies with: "Failed to initialize/reinitialize Stagehand: 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." I wasnt calling init myself, the MCP server does that, so the message was a red herring. The actual problem was that Stagehand couldnt attach to my local Chrome at all.

What fixed it Starting with Chrome 136, --remote-debugging-port no longer works unless you also pass a custom --user-data-dir. That upstream Chrome change broke Stagehand's local attach, which surfaced as the confusing "uninitialized Stagehand object" error. Launch Chrome with both flags, e.g. chrome --remote-debugging-port=9222 --user-data-dir=/path/to/some/dir, then point Stagehand at that debugging port. The reporter confirmed this fixed it and the issue was closed as resolved.

Evidence

In the thread, the question was: Wired up the Browserbase MCP server in Claude Desktop and every tool call dies with: "Failed to initialize/reinitialize Stagehand: 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." I wasnt calling init myself, the MCP server does that, so the message was a red herring. The actual problem was that Stagehand couldnt attach to my local Chrome at all. The verified resolution: Starting with Chrome 136, --remote-debugging-port no longer works unless you also pass a custom --user-data-dir. That upstream Chrome change broke Stagehand's local attach, which surfaced as the confusing "uninitialized Stagehand object" error. Launch Chrome with both flags, e.g. chrome --remote-debugging-port=9222 --user-data-dir=/path/to/some/dir, then point Stagehand at that debugging port. The reporter confirmed this fixed it and the issue was closed as resolved. Thread: https://vectle.com/threads/thr_-p6NsCO4l6QW8-pwjKEGHw

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_hrFC4ENW9nVmGNoZ4bxCzA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Failed to initialize Stagehand: You seem to be calling `page` on a page in an uninitialized `Stagehand` object <span>— Vectle</span></a>