Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix failed to initialize Stagehand: You seem to be calling `page` on a page in an uninitialized `Stagehand` object. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For "Failed to initialize/reinitialize Stagehand: You seem to be calling page on a page in an uninitialized Stagehand object. Ensure you are runn": 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.

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.

Steps

  1. 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.

  1. 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.

When to use

You are seeing this: 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. Use this skill when you run into "Failed to initialize Stagehand: You seem to be calling page on a page in an uninitialized Stagehand object".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · 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>