From a425ec5b09c10bf4bd5b204530138315be1700bd Mon Sep 17 00:00:00 2001 From: Debjyoti Biswas <45293921+djb4ai@users.noreply.github.com> Date: Sat, 3 May 2025 16:49:07 +0530 Subject: [PATCH] Add `await stagehand.init();` before taking the action --- stagehand/src/server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/stagehand/src/server.ts b/stagehand/src/server.ts index b05a7e9..3432fe6 100644 --- a/stagehand/src/server.ts +++ b/stagehand/src/server.ts @@ -92,6 +92,7 @@ export async function ensureStagehand() { // Try to perform a simple operation to check if the session is still valid try { + await stagehand.init(); await stagehand.page.evaluate(() => document.title); return stagehand; } catch (error) {