Repository navigation
fix(frontend): make Playwright webServer command portable - #5185
Conversation
Huixin615
left a comment
There was a problem hiding this comment.
@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.
…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.

Fixes #5184
Why
The default Playwright
webServercommand starts Next.js through./node_modules/.bin/next. Playwright executes that command throughcmd.exeon 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/backend/applanggraph.json, or prompt changedocker/or sandboxed executionskills/backend/pyproject.tomlorfrontend/package.jsonScreenshots / Recording
Not applicable; this changes only the E2E server launcher.
Bug fix verification
frontend/tests/e2e/sidecar-chat.spec.ts, focused oncreates a hidden sidecar thread.main: yes. Playwright exited before test collection with'.' is not recognized as an internal or external command.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 automaticallypnpm typecheck— passedpnpm format— passedpnpm lint— passedgit diff --check— passedAI 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.