reflex-dev/reflex · error · ConfigError

f"Config file not found at {yaml_path}."

Error message

f"Config file not found at {yaml_path}."

What it means

ConfigError raised by CloudConfig.from_yaml when the given YAML path does not exist on disk. The CLI loads its cloud config from rxconfig.yaml by default, so this means the config file is missing at the expected location.

Source

Thrown at packages/reflex-hosting-cli/src/reflex_cli/core/config.py:214

        cls,
        yaml_path: Path = Path.cwd() / constants.Dirs.CLOUD_YAML,
        env: str | None = None,
    ) -> Config:
        """Creates a Config instance from a YAML file.

        Args:
            yaml_path: The path to the YAML file. Defaults to "cloud.yml" in the current directory.
            env: The environment to load the config for.

        Returns:
            Config: A Config instance with the values from the YAML file.

        Raises:
            ConfigError: If the YAML file is not found.

        """
        if not yaml_path.exists():
            raise ConfigError(f"Config file not found at {yaml_path}.")

        try:
            import yaml
        except ImportError as e:
            raise ConfigError(
                "YAML support is not available. Please install PyYAML to use this feature."
            ) from e

        with yaml_path.open() as file:
            data = yaml.safe_load(file)
            if env:
                data = data.get("env", {}).get(env, {})
            data = cls._filter_dict(data)
        return cls(_cloud_config_path=yaml_path, **data)

    @classmethod
    def from_toml(
        cls,

View on GitHub (pinned to 45b8ed5ab7)

Solutions

  1. Create the YAML config file at the reported path (or run the CLI from the project root so it generates one)
  2. Check the path for typos, especially with a custom --configfile argument
  3. If you intended TOML config, ensure the CLI resolves to pyproject.toml instead, or create rxconfig.yaml

Example fix

# before
config = CloudConfig.from_yaml(Path("rxconf.yaml"))  # typo

# after
config = CloudConfig.from_yaml(Path("rxconfig.yaml"))
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
yaml_path = Path("rxconfig.yaml")
if not yaml_path.exists():
    raise FileNotFoundError(f"missing {yaml_path}")
config = CloudConfig.from_yaml(yaml_path)

Try / catch

from reflex_cli.core.config import ConfigError
try:
    config = CloudConfig.from_yaml(path)
except ConfigError as e:
    if "not found" in str(e):
        config = CloudConfig()  # fall back to defaults
    else:
        raise

Prevention

When it happens

Trigger: Calling CloudConfig.from_yaml(path) with a non-existent path, or running a hosting CLI command that resolves the config path (from_yaml_or_toml_or_none / read_config) to a YAML file that was deleted or never created.

Common situations: Running hosting commands in a fresh project where rxconfig.yaml hasn't been generated yet; passing a custom --configfile path with a typo; the file being removed by a clean/git operation.

Related errors


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