Skip to content

Commit 1319b13

Browse files
committed
docs: Add comprehensive deployment and Playwright version management guides, including exact version locking.
1 parent c7a33ec commit 1319b13

4 files changed

Lines changed: 159 additions & 9 deletions

File tree

docs/DEPLOYMENT.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,37 @@ nano .env
309309
docker compose restart
310310
```
311311

312+
### Playwright Version Mismatch
313+
314+
**Error**: `Executable doesn't exist at /ms-playwright/...`
315+
316+
**Cause**: Playwright npm version doesn't match Docker image version.
317+
318+
**Solution**:
319+
```bash
320+
# Check versions
321+
cat package.json | grep playwright
322+
cat Dockerfile | grep playwright
323+
324+
# They should match exactly (e.g., both 1.49.0)
325+
326+
# If not, update package.json to exact version (no ^)
327+
nano package.json
328+
# Change "playwright": "^1.49.0" to "playwright": "1.49.0"
329+
330+
# Rebuild with no cache
331+
docker compose down
332+
docker compose build --no-cache
333+
docker compose up -d
334+
335+
# Verify
336+
docker compose logs -f
337+
```
338+
339+
**Prevention**: Always use exact Playwright versions in package.json (no `^` or `~`).
340+
341+
See [VERSION_MANAGEMENT.md](VERSION_MANAGEMENT.md) for details.
342+
312343
## 🔐 Security Best Practices
313344

314345
1. **Use Strong API Key**

docs/VERSION_MANAGEMENT.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Version Management
2+
3+
## Playwright Version Locking
4+
5+
This project uses **exact version locking** for Playwright to ensure consistency between the Docker image and npm package.
6+
7+
### Current Versions
8+
9+
- **Playwright**: `1.49.0` (exact, no caret)
10+
- **Docker Image**: `mcr.microsoft.com/playwright:v1.49.0-jammy`
11+
12+
### Why Exact Version?
13+
14+
Playwright requires the browser binaries to match the npm package version exactly. Using `^1.49.0` could install a newer version (e.g., 1.57.0) which won't match the Docker image browsers.
15+
16+
## Updating Playwright
17+
18+
When updating Playwright, you must update **both** files:
19+
20+
### 1. Update package.json
21+
22+
```json
23+
{
24+
"dependencies": {
25+
"playwright": "1.XX.0" // Exact version, no ^
26+
}
27+
}
28+
```
29+
30+
### 2. Update Dockerfile
31+
32+
```dockerfile
33+
FROM mcr.microsoft.com/playwright:v1.XX.0-jammy
34+
```
35+
36+
### 3. Regenerate package-lock.json
37+
38+
```bash
39+
rm package-lock.json
40+
npm install
41+
```
42+
43+
### 4. Test Locally
44+
45+
```bash
46+
npm start
47+
# Test endpoints
48+
```
49+
50+
### 5. Test with Docker
51+
52+
```bash
53+
docker compose build
54+
docker compose up
55+
# Test endpoints
56+
```
57+
58+
## Version Compatibility Matrix
59+
60+
| Playwright npm | Docker Image | Status |
61+
|----------------|--------------|--------|
62+
| 1.49.0 | v1.49.0-jammy | ✅ Current |
63+
| 1.50.0 | v1.50.0-jammy | ⚠️ Not tested |
64+
| 1.51.0+ | v1.51.0-jammy+ | ⚠️ Not tested |
65+
66+
## Troubleshooting Version Mismatches
67+
68+
### Error: "Executable doesn't exist"
69+
70+
This means the Playwright npm version doesn't match the Docker image.
71+
72+
**Solution:**
73+
74+
1. Check current versions:
75+
```bash
76+
# Check package.json
77+
cat package.json | grep playwright
78+
79+
# Check Dockerfile
80+
cat Dockerfile | grep playwright
81+
```
82+
83+
2. Make sure they match exactly
84+
85+
3. Rebuild:
86+
```bash
87+
docker compose down
88+
docker compose build --no-cache
89+
docker compose up -d
90+
```
91+
92+
### Error: "Please update docker image"
93+
94+
Playwright was updated but Docker image wasn't.
95+
96+
**Solution:**
97+
98+
Update Dockerfile to match the Playwright version in package.json.
99+
100+
## Security Updates
101+
102+
If there's a critical security update for Playwright:
103+
104+
1. Update both package.json and Dockerfile
105+
2. Test thoroughly
106+
3. Update this document
107+
4. Create a new release
108+
109+
## Notes
110+
111+
- Always use exact versions (no `^` or `~`)
112+
- Keep package.json and Dockerfile in sync
113+
- Test after every Playwright update
114+
- Document breaking changes in CHANGELOG.md
115+
116+
---
117+
118+
**Last Updated**: 2025-12-09
119+
**Current Playwright Version**: 1.49.0

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"dependencies": {
3535
"@hono/node-server": "^1.13.7",
3636
"hono": "^4.6.14",
37-
"playwright": "^1.49.0"
37+
"playwright": "1.49.0"
3838
},
3939
"engines": {
4040
"node": ">=18.0.0"

0 commit comments

Comments
 (0)