Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix: adjust Playwright service response to match API schema expectations

NBR0KN5e267f92ffce
diff --git a/apps/playwright-service-ts/api.ts b/apps/playwright-service-ts/api.ts
index 90a4eb87b..eacb35fff 100644
--- a/apps/playwright-service-ts/api.ts
+++ b/apps/playwright-service-ts/api.ts
@@ -196,7 +196,7 @@ app.post('/scrape', async (req: Request, res: Response) => {
}
}
- const pageError = pageStatusCode !== 200 ? getError(pageStatusCode) : false;
+ const pageError = pageStatusCode !== 200 ? getError(pageStatusCode) : undefined;
if (!pageError) {
console.log(`✅ Scrape successful!`);
@@ -209,7 +209,7 @@ app.post('/scrape', async (req: Request, res: Response) => {
res.json({
content: pageContent,
pageStatusCode,
- pageError
+ ...(pageError && { pageError })
});
});