Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • externalize playwright and ws

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Dec 13, 2025 4:13am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 13, 2025

Greptile Overview

Greptile Summary

Added ws, playwright, and playwright-core to serverExternalPackages to prevent Next.js from bundling these native modules (which can cause build failures). Also configured outputFileTracingIncludes to ensure these dependencies are properly included in the serverless function bundle for the /api/tools/stagehand/* routes.

  • Externalizes ws and playwright packages from Next.js bundling to avoid native module compilation issues
  • Adds outputFileTracingIncludes to ensure stagehand API routes have access to ws and playwright in production deployments

Confidence Score: 5/5

  • This PR is safe to merge - it's a standard Next.js configuration fix for native module bundling
  • The changes are minimal, well-targeted configuration adjustments to next.config.ts. Adding packages to serverExternalPackages and outputFileTracingIncludes is a common pattern for handling native Node.js modules in Next.js deployments.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/next.config.ts 5/5 Adds ws, playwright, and playwright-core to serverExternalPackages and configures outputFileTracingIncludes for stagehand API routes to fix build bundling issues.

Sequence Diagram

sequenceDiagram
    participant Client
    participant NextJS as Next.js Server
    participant Stagehand as Stagehand API
    participant WS as ws module
    participant PW as playwright-core

    Client->>NextJS: POST /api/tools/stagehand/*
    NextJS->>Stagehand: Route to API handler
    Note over Stagehand: Imports @browserbasehq/stagehand
    Stagehand->>WS: WebSocket connections (externalized)
    Stagehand->>PW: Browser automation (externalized)
    PW-->>Stagehand: Browser instance
    Stagehand-->>NextJS: Response
    NextJS-->>Client: JSON result
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 9e3e186 into staging Dec 13, 2025
3 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/nextconfig branch December 13, 2025 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants