Skip to content

Commit 90559f8

Browse files
aldro61claude
andcommitted
Add early playwright version check to prevent cryptic errors
Check that playwright==1.44.0 is installed at import time and raise a clear error message if the wrong version is detected. This prevents users from encountering confusing errors later due to version mismatch. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 80c473d commit 90559f8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/browsergym/workarena/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
__version__ = "0.5.1"
22

3+
# Check playwright version early to avoid cryptic errors
4+
import importlib.metadata
5+
6+
_playwright_version = importlib.metadata.version("playwright")
7+
if _playwright_version != "1.44.0":
8+
raise RuntimeError(
9+
f"browsergym-workarena requires playwright==1.44.0, but found {_playwright_version}. "
10+
f"Please install the correct version: pip install playwright==1.44.0"
11+
)
12+
313
import inspect
414
from logging import warning
515

0 commit comments

Comments
 (0)