|
| 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 |
0 commit comments