-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Summary
- With Zod 4.0.17 installed, importing Stagehand triggers TypeScript errors coming from Stagehand’s published types that import zod/v3.
- Pinning to Zod 3.25.76 makes the errors disappear.
- Stagehand’s peer range allows 4.0.x (>=3.25.0 <4.1.0), so this appears to be an unintended incompatibility.
Environment
- @browserbasehq/stagehand: 2.4.3
- zod: 4.0.17 (errors) vs 3.25.76 (works)
Steps To Reproduce:
npx create-browser-app
- install zod 4.0.17 (allowed by stagehand׳s peer dependencies decleration)
- replace index.ts with the following:
import { Stagehand } from '@browserbasehq/stagehand'
const stagehand = new Stagehand({
env: 'BROWSERBASE',
apiKey: '',
projectId: '',
modelName: 'gpt-4o',
modelClientOptions: {
apiKey: ''
},
})
;(async () => {
try {
await stagehand.init()
await stagehand.page.goto('https://google.com')
const res = await stagehand.agent().execute({
instruction: 'search for "Browserbase"',
maxSteps: 5
})
console.dir({ res }, { depth: null })
} catch (e) {
console.error(e)
} finally {
await stagehand.close()
}
})()
- run and inspect logs:
BadRequestError: 400 Invalid schema for response_format 'operatorResponseSchema': schema must be a JSON Schema of 'type: "object"', got 'type: "None"'.
Metadata
Metadata
Assignees
Labels
No labels