fix: don't fail website build when Playwright browser deps are missing - #11469
Open
timotheeguerin with Copilot wants to merge 4 commits into
Open
fix: don't fail website build when Playwright browser deps are missing#11469timotheeguerin with Copilot wants to merge 4 commits into
timotheeguerin with Copilot wants to merge 4 commits into
Conversation
|
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. |
4 tasks
…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>
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
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
… dev Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
timotheeguerin
marked this pull request as ready for review
July 30, 2026 13:38
timotheeguerin
requested review from
catalinaperalta,
iscai-msft,
markcowl and
xirzec
as code owners
July 30, 2026 13:38
|
You can try these changes here
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pnpm buildfails on Ubuntu 24 when Playwright system dependencies (libatk, libxcomposite, etc.) aren't installed, despite Playwright being documented as optional. The culprit isrehype-mermaiddefaulting to theinline-svgstrategy, which launches a Chromium browser to pre-render Mermaid diagrams as SVGs.Changes
website/astro.config.mjs: AddedgetMermaidStrategy()that attempts to launch a Playwright browser at build startup. On success, usesinline-svg(server-side SVG, existing behavior). On any failure — Playwright not installed, or system browser deps missing — falls back topre-mermaidwith a descriptive warning. Thepre-mermaidstrategy 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.