fix(frontend): make Playwright webServer command portable by Ricky-7-Yan · Pull Request #5185 · bytedance/deer-flow · GitHub
Skip to content

fix(frontend): make Playwright webServer command portable - #5185

Merged
WillemJiang merged 1 commit into
bytedance:mainfrom
Ricky-7-Yan:fix/windows-playwright-webserver
Sep 6, 2026
Merged

WillemJiang merged 1 commit into
bytedance:mainfrom
Ricky-7-Yan:fix/windows-playwright-webserver

Conversation

@Ricky-7-Yan

@Ricky-7-Yan Ricky-7-Yan commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #5184

Why

The default Playwright webServer command starts Next.js through ./node_modules/.bin/next. Playwright executes that command through cmd.exe on Windows, where the extensionless POSIX shim cannot be resolved, so E2E tests exit before the server or any test starts.

What changed

The Playwright server command now invokes Next.js through pnpm exec, which resolves the platform-appropriate package binary on Windows and Unix-like systems. Runtime application behavior is unchanged.

Surface area

  • Frontend UI — page / component / setting / interaction under frontend/
  • Backend API — endpoint / SSE event / request-response shape under backend/app
  • Agents / LangGraph — agent node, graph wiring, langgraph.json, or prompt change
  • Sandbox — docker/ or sandboxed execution
  • Skills — change under skills/
  • Dependencies — new/upgraded entry in backend/pyproject.toml or frontend/package.json
  • Default behavior change — changes existing product behavior without the user opting in
  • Docs / tests / CI only — no runtime behavior change

Screenshots / Recording

Not applicable; this changes only the E2E server launcher.

Bug fix verification

  • Test path: frontend/tests/e2e/sidecar-chat.spec.ts, focused on creates a hidden sidecar thread.
  • Red on main: yes. Playwright exited before test collection with '.' is not recognized as an internal or external command.
  • Green on this branch: yes. The same command let Playwright build and start Next.js and completed with 1 passed (1.2m).

Validation

  • pnpm exec playwright test tests/e2e/sidecar-chat.spec.ts --grep "creates a hidden sidecar thread" — 1 passed; the configured web server built and started automatically
  • pnpm typecheck — passed
  • pnpm format — passed
  • pnpm lint — passed
  • git diff --check — passed

AI assistance

Tool(s) used: OpenAI Codex

How you used it: Reproduced the Windows launcher failure, checked for duplicate reports, changed the single Playwright command, and ran the validation listed above.

  • I've read and understand every line of this change and take responsibility for it — it's not unreviewed AI output.

@Ricky-7-Yan
Ricky-7-Yan marked this pull request as ready for review September 4, 2026 15:49
@github-actions github-actions Bot added area:frontend Next.js frontend under frontend/ risk:medium Medium risk: regular code changes size/XS PR changes < 20 lines labels Sep 4, 2026

@Huixin615 Huixin615 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Ricky-7-Yan Thanks for the clear report and focused fix.

I confirmed that the issue is valid: under Windows cmd.exe, ./node_modules/.bin/next cannot execute the POSIX shim, so Playwright's web server exits before Next.js starts. Resolving Next.js through pnpm exec selects the platform-appropriate executable and fixes both the build and start phases. The approach is also consistent with playwright.auth.config.ts.

From the code changes, there are no issues affecting correctness. However, before merging, end-to-end testing should provide results for greater rigor.

Non-blocking nit: pnpm run preview could reuse the existing package script and avoid duplicating the build/start command, but the proposed command is functionally correct.

@Ricky-7-Yan

Copy link
Copy Markdown
Contributor Author

@WillemJiang WillemJiang added this to the 2.1.0 milestone Sep 6, 2026
@WillemJiang
WillemJiang merged commit b002d55 into bytedance:main Sep 6, 2026
19 of 25 checks passed
PiedPiper911 added a commit to PiedPiper911/deer-flow that referenced this pull request Sep 25, 2026
…landing (bytedance#3909)

Rebased onto current main. The only upstream overlap was the Playwright
webServer command, which main made portable via `pnpm exec` (bytedance#5185); this
keeps that form inside the two-server array, and next.config.js picks up
the main-side changes with the static distDir switch preserved.

Behaviour is unchanged from the previous head:

- `/` in a full deployment resolves the session and redirects
  (authenticated -> /workspace, needs_setup -> /setup, unauthenticated ->
  /login, config_error -> throw instead of falling through to the landing).
- The marketing landing is still served in static-website mode, exercised
  by the dedicated `static-website` Playwright project on port 3100 with
  `client/.next-static` as its distDir.
- E2E: the static-mode Get Started assertion keeps the 30s window and
  matches with a RegExp, so it no longer compares a baseURL-resolved
  string against an absolute URL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Next.js frontend under frontend/ risk:medium Medium risk: regular code changes size/XS PR changes < 20 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Playwright webServer cannot start on Windows

3 participants