-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Before submitting an issue, please:
- Check the documentation for relevant information
- Search existing issues to avoid duplicates
Environment Information
Please provide the following information to help us reproduce and resolve your issue:
Stagehand:
- Language/SDK: [TypeScript, Python, MCP…]
- Stagehand version: [e.g., 3.0.1]
AI Provider:
- Provider: N/A (not used in this repro)
- Model: N/A
Issue Description
`stagehand.init()` resolves to `undefined` when using env "BROWSERBASE", even though the session starts successfully.
The Stagehand logs print `sessionUrl`, `debugUrl`, and `sessionId`, but the variable that awaits `init()` is `undefined`.
Steps to Reproduce
- Create a Stagehand instance with the example https://docs.stagehand.dev/v3/configuration/browser#advanced-configuration.
- Call const result = await stagehand.init();
- Log the value: console.log("result" ,result); → it prints undefined, while Stagehand logs show the session details.
Minimal Reproduction Code
// Your minimal reproduction code here
import { Stagehand } from '@browserbase/stagehand';
const stagehand = new Stagehand({
// IMPORTANT: include your stagehand config
env: 'BROWSERBASE',
apiKey: 'REDACTED',
projectId: 'REDACTED',
browserbaseSessionCreateParams: {
projectId: 'REDACTED',
proxies: false,
region: 'us-west-2',
timeout: 3600,
keepAlive: true,
browserSettings: {
advancedStealth: false,
blockAds: true,
solveCaptchas: true,
recordSession: false,
viewport: { width: 1920, height: 1080 },
},
},
userMetadata: {
userId: 'automation-user-123',
environment: 'production',
},
});
// Steps that reproduce the issue
(async () => {
const config = await stagehand.init();
console.log('CONFIG', config); // => undefined (unexpected)
})();Error Messages / Log trace
[2025-11-05 22:18:43.008 +0000] INFO: Using Browserbase credentials
category: "init"
[2025-11-05 22:18:43.008 +0000] INFO: Starting browserbase session
category: "init"
[2025-11-05 22:18:43.009 +0000] INFO: Creating new browserbase session...
category: "init"
CONFIG undefined
[2025-11-05 22:18:48.999 +0000] INFO: Browserbase session started
category: "init"
sessionUrl: "https://www.browserbase.com/sessions/<redacted>"
debugUrl: "https://www.browserbase.com/devtools/inspector.html?wss=connect.browserbase.com/debug/<redacted>/devtools/page/<redacted>?debug=true"
sessionId: "9c3b72bc-a519-4aa6-b849-a364a0723684"
Screenshots / Videos
Related Issues
Are there any related issues or PRs?
- Related to: #[issue number]
- Duplicate of: #[issue number]
- Blocks: #[issue number]
Metadata
Metadata
Assignees
Labels
No labels