reflex-dev/reflex · error · AttributeError

{name}

Error message

{name}

What it means

The AppHarness driver helper could not build Selenium driver options for the requested browser driver class. The code inspects the driver class name (chrome/firefox/etc.) to pick the matching Options object; an unknown or misspelled driver name leaves driver_options None and this RuntimeError is raised. It indicates an unsupported browser was requested via APP_HARNESS_DRIVER.

Source

Thrown at packages/reflex-base/src/reflex_base/components/component.py:131

            instance: The component instance, or ``None`` for class access.
            owner: The owning class.

        Returns:
            ``self`` for class access, otherwise the default. Factory defaults
            are cached on the instance so later in-place mutation persists.

        Raises:
            AttributeError: The field has neither a default nor a factory.
        """
        if instance is None:
            return self
        if self.default is not MISSING:
            return self.default
        if self.default_factory is not None:
            value = self.default_factory()
            instance.__dict__[self._name] = value
            return value
        raise AttributeError(self._name)


def field(
    default: FIELD_TYPE | _MISSING_TYPE = MISSING,
    default_factory: Callable[[], FIELD_TYPE] | None = None,
    is_javascript_property: bool | None = None,
    doc: str | None = None,
) -> FIELD_TYPE:
    """Create a field for a component.

    Args:
        default: The default value for the field.
        default_factory: The default factory for the field.
        is_javascript_property: Whether the field is a javascript property.
        doc: Documentation string for the field.

    Returns:
        The field for the component.

View on GitHub (pinned to 45b8ed5ab7)

Solutions

  1. Set APP_HARNESS_DRIVER to a supported browser (chrome or firefox)
  2. Check the spelling/value of APP_HARNESS_DRIVER in your CI environment variables
  3. If you need another browser, extend the options-selection logic or pass preconfigured driver_options to the call

Example fix

# before
environment.APP_HARNESS_DRIVER.set("chromee")
# after
environment.APP_HARNESS_DRIVER.set("chrome")
Defensive patterns

Strategy: validation

Validate before calling

from reflex.utils import environment
assert environment.APP_HARNESS_DRIVER.get().lower() in ("chrome", "firefox")

Prevention

When it happens

Trigger: Setting environment APP_HARNESS_DRIVER to a webdriver class whose name doesn't match a known browser (e.g. APP_HARNESS_DRIVER=Safari when only chrome/firefox option mapping is handled), or a custom driver class passed as driver_clz the function can't map to Options.

Common situations: CI configs pinning a browser the harness doesn't map; typos in the APP_HARNESS_DRIVER env var; upgrading Selenium where class names changed; running on browsers without headless option support in the mapping.

Related errors


AI-assisted analysis of reflex-dev/reflex@45b8ed5ab7 (2026-08-28). Data as JSON: /api/errors/5e73963fcde228ec. Report an issue: GitHub.