CloakHQ/CloakBrowser · error · TypeError

The 'backend' parameter has been removed — patchright is no

Error message

The 'backend' parameter has been removed — patchright is no longer supported and stock Playwright is the only backend. Remove the argument.

What it means

cloakbrowser no longer supports the patchright backend; stock Playwright is the only backend. Passing backend=... to any launch function (launch, launch_async, launch_persistent_context, launch_context, etc.) now raises TypeError via _check_removed_kwargs, since removed parameters fall into **kwargs and are detected explicitly.

Source

Thrown at cloakbrowser/browser.py:301

    if "no_viewport" in kwargs and "viewport" in context_kwargs:
        logger.debug("Both viewport and no_viewport requested; no_viewport (kwargs) wins")
        context_kwargs.pop("viewport", None)


def _resolve_timezone(timezone: str | None, kwargs: dict[str, Any]) -> str | None:
    """Accept both timezone and timezone_id — either works, no warning."""
    if "timezone_id" in kwargs:
        if timezone is None:
            timezone = kwargs.pop("timezone_id")
        else:
            kwargs.pop("timezone_id")
    return timezone


def _check_removed_kwargs(kwargs: dict[str, Any]) -> None:
    """Raise a clear error for removed parameters that now fall into **kwargs."""
    if "backend" in kwargs:
        raise TypeError(
            "The 'backend' parameter has been removed — patchright is no longer "
            "supported and stock Playwright is the only backend. Remove the argument."
        )


class _ProxySettingsRequired(TypedDict):
    server: str


class ProxySettings(_ProxySettingsRequired, total=False):
    """Playwright-compatible proxy configuration."""

    bypass: str
    username: str
    password: str


def launch(

View on GitHub (pinned to d6bad5de26)

Solutions

  1. Remove the backend argument from all launch calls
  2. Delete any backend-selection helper/config that passes it
  3. Upgrade code samples/READMEs to the current API

Example fix

# before
browser = cloakbrowser.launch(backend="patchright")
# after
browser = cloakbrowser.launch()
Defensive patterns

Strategy: type-guard

Validate before calling

def is_supported_kwargs(kwargs: dict) -> bool:
    return "backend" not in kwargs

Type guard

def clean_launch_kwargs(kwargs: dict[str, Any]) -> dict[str, Any]:
    kwargs.pop("backend", None)  # removed in current API
    return kwargs

Prevention

When it happens

Trigger: Calling cloakbrowser.launch(backend='patchright') or any launch*/launch_context* variant with a backend keyword argument.

Common situations: Upgrading from an older cloakbrowser version that allowed backend='patchright'/'playwright'; copy-pasted old example code or stale tutorials.

Related errors


AI-assisted analysis of CloakHQ/CloakBrowser@d6bad5de26 (2026-08-28). Data as JSON: /api/errors/299fcc5af9bdd469. Report an issue: GitHub.