From 5a4af1b4daf19887292ea36b5bda690e8057138d Mon Sep 17 00:00:00 2001 From: BaaRai <130491490+BaaRai@users.noreply.github.com> Date: Wed, 18 Nov 2026 18:25:45 +0100 Subject: [PATCH] fix(docker): install MCP chromium through its linked playwright-core playwright-core's exports map does not expose ./cli.js, so require.resolve threw inside the command substitution, the outer node got an empty script path, and the build still succeeded without installing chromium v1247. Run the binary npm links for @playwright/mcp instead. Verified with docker build: both v1247 and v1248 are in the cache, and @playwright/mcp's playwright-core launches 155.0.8059.12. --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 48cbf37..1a623e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -181,10 +181,13 @@ RUN set -eux; \ ARG PLAYWRIGHT_MCP_VERSION=0.0.83 ARG PLAYWRIGHT_CLI_VERSION=0.1.22 ARG PLAYWRIGHT_VERSION=1.64.1 +# playwright-core's exports map hides cli.js from require.resolve, so run the +# binary npm links for @playwright/mcp instead: it is the copy MCP actually +# loads, and it installs the Chromium revision that copy expects. RUN npm install -g "@playwright/mcp@${PLAYWRIGHT_MCP_VERSION}" "@playwright/cli@${PLAYWRIGHT_CLI_VERSION}" "playwright@${PLAYWRIGHT_VERSION}" \ && playwright-cli --help \ && playwright install --with-deps chromium \ - && node "$(node -p 'require.resolve("playwright-core/cli.js",{paths:["/usr/local/lib/node_modules/@playwright/mcp"]})')" install chromium \ + && "$(npm root -g)/@playwright/mcp/node_modules/.bin/playwright-core" install chromium \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Binary compiled from source in the build stage above.