Docs: E2E instructions say `pnpm run build`, which strips the mock bridge and breaks all smoke specs

Open Beginner friendly
#3,207 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
playwright, typescript, vite

Research direction

Start with the listed E2E guidance in AGENTS.md and desktop/src-tauri/src/managed_agents/screenshot_skill.md, then check the header comments in the four named desktop/tests/e2e/.perf.ts files. Compare the commands with the test:e2e scripts and main.tsx; done means every cited instruction uses the E2E build mode and warns about the plain production build stripping the mock bridge.

Written by the indexing model from the issue text.

Description

Problem

The E2E docs tell contributors to run a plain production build before re-running Playwright tests, which produces a bundle without the E2E Tauri mock bridge — so every smoke spec fails at boot.

Occurrences of the wrong instruction:

  • AGENTS.md — "Writing E2E Screenshot Specs" → Stale server paragraph: "Kill port 4173 and pnpm run build before re-running tests after code changes."
  • desktop/src-tauri/src/managed_agents/screenshot_skill.md — Gotcha 1 repeats the same pnpm run build advice.
  • Header comments of the four perf specs in desktop/tests/e2e/ (typing-latency.perf.ts, scroll-smoothness.perf.ts, warm-switch-markdown.perf.ts, cold-switch-longtask.perf.ts) say to run pnpm build first — they all call installMockBridge, so the same failure applies.
Why it fails

desktop/src/main.tsx deliberately compiles the mock bridge only into dev and explicit E2E builds:

if (
  !(import.meta.env.DEV || import.meta.env.MODE === "e2e") ||
  !(window as E2eWindow).__BUZZ_E2E__
) {
  return;
}
const { maybeInstallE2eTauriMocks } = await import("@/testing/e2eBridge");

pnpm build (vite build) runs in production mode, so the bridge is stripped. The Playwright web server (python3 -m http.server 4173 -d dist) then serves a bridge-less bundle and every spec that calls installMockBridge dies at boot with:

Community connection failed / Cannot read properties of undefined (reading 'invoke')

The correct command is pnpm build:e2e (vite build --mode e2e) — it's what the test:e2e* package scripts already use.

Impact

Two independent agent sessions lost real debugging time to this on 2026-07-27, chasing what looked like an app regression but was just a doc-induced wrong build mode.

Fix

Update the docs (and perf-spec header comments) to say pnpm build:e2e, with a one-line warning that a plain pnpm build strips the mock bridge.

Dominant language
Rust
Stars
33.7k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
239

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from block/buzz

All issues in block/buzz

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.