Skip to content

fix: don't fail website build when Playwright browser deps are missing - #11469

Open
timotheeguerin with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-pnpm-build-failure
Open

fix: don't fail website build when Playwright browser deps are missing#11469
timotheeguerin with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-pnpm-build-failure

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

pnpm build fails on Ubuntu 24 when Playwright system dependencies (libatk, libxcomposite, etc.) aren't installed, despite Playwright being documented as optional. The culprit is rehype-mermaid defaulting to the inline-svg strategy, which launches a Chromium browser to pre-render Mermaid diagrams as SVGs.

Changes

  • website/astro.config.mjs: Added getMermaidStrategy() that attempts to launch a Playwright browser at build startup. On success, uses inline-svg (server-side SVG, existing behavior). On any failure — Playwright not installed, or system browser deps missing — falls back to pre-mermaid with a descriptive warning. The pre-mermaid strategy emits <pre class="mermaid"> elements for client-side rendering; no Playwright required.

  • CONTRIBUTING.md: Updated the optional Playwright step to use --with-deps chromium, clarify that it also enables server-side Mermaid diagram rendering (not just UI testing), and note that builds succeed without it.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

…build

When Playwright browser system dependencies are not installed, the
`rehype-mermaid` plugin would throw an error and fail the entire build.

This change detects Playwright availability at build time by attempting
to launch a browser. If that succeeds, the existing `inline-svg`
strategy is used (server-side SVG rendering). If it fails for any
reason (Playwright not installed, or system browser deps missing),
we fall back to the `pre-mermaid` strategy which renders Mermaid
diagrams client-side and does not require Playwright.

Also updates CONTRIBUTING.md to clarify the effect of not having
Playwright installed (mermaid diagrams fall back to client-side
rendering instead of failing the build).

Fixes #5272

Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the meta:website TypeSpec.io updates label Jul 30, 2026
Copilot AI changed the title [WIP] Fix pnpm build failure when playwright dependencies are missing fix: don't fail website build when Playwright browser deps are missing Jul 30, 2026
Copilot AI requested a review from timotheeguerin July 30, 2026 01:49
Comment thread website/astro.config.mjs
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Comment thread website/astro.config.mjs Outdated
… dev

Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copilot AI requested a review from timotheeguerin July 30, 2026 13:37
@timotheeguerin
timotheeguerin marked this pull request as ready for review July 30, 2026 13:38
@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "pnpm build" fails if playwright deps are not installed

2 participants