Skip to content

Commit d2222b4

Browse files
committed
fix: pin playwright package version to match Docker image (v1.52.0)
1 parent c24a462 commit d2222b4

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

internal/connector/browser.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import (
88
)
99

1010
const (
11-
playwrightNodeImage = "mcr.microsoft.com/playwright:v1.52.0-noble"
12-
playwrightPythonImage = "mcr.microsoft.com/playwright/python:v1.52.0-noble"
11+
playwrightVersion = "1.52.0"
12+
playwrightNodeImage = "mcr.microsoft.com/playwright:v" + playwrightVersion + "-noble"
13+
playwrightPythonImage = "mcr.microsoft.com/playwright/python:v" + playwrightVersion + "-noble"
1314
)
1415

1516
// BrowserRunConnector wraps user Playwright scripts with boilerplate and
@@ -110,18 +111,18 @@ func (c *BrowserRunConnector) Execute(ctx context.Context, params map[string]any
110111
// The official Playwright Docker image ships browsers and system deps but
111112
// NOT the npm package. Install it (pinned to match the image version) then
112113
// run the wrapper from stdin.
113-
containerCmd = []string{"sh", "-c", "npm install --no-save --silent playwright 2>/dev/null && node"}
114+
containerCmd = []string{"sh", "-c", "npm install --no-save --silent playwright@" + playwrightVersion + " 2>/dev/null && node"}
114115
case "typescript":
115116
containerImage = playwrightNodeImage
116117
wrapperScript = buildJSWrapper(script)
117118
// Same as JS but with TypeScript type-stripping enabled.
118-
containerCmd = []string{"sh", "-c", "npm install --no-save --silent playwright 2>/dev/null && node --experimental-strip-types"}
119+
containerCmd = []string{"sh", "-c", "npm install --no-save --silent playwright@" + playwrightVersion + " 2>/dev/null && node --experimental-strip-types"}
119120
case "python":
120121
containerImage = playwrightPythonImage
121122
wrapperScript = buildPythonWrapper(script)
122123
// The official Playwright Python image ships browsers and system deps but
123-
// NOT the pip package. Install it then run the wrapper from stdin.
124-
containerCmd = []string{"sh", "-c", "pip install --quiet playwright 2>/dev/null && python3 -"}
124+
// NOT the pip package. Pin to match the image version.
125+
containerCmd = []string{"sh", "-c", "pip install --quiet playwright==" + playwrightVersion + " 2>/dev/null && python3 -"}
125126
}
126127

127128
// --- build docker/run params ---

0 commit comments

Comments
 (0)