{"record":{"id":"9a5101d7395e2678","repo":"reflex-dev/reflex","slug":"config-file-not-found-at-pyproject-path","errorCode":null,"errorMessage":"Config file not found at {pyproject_path}.","messagePattern":"Config file not found at (.+?)\\.","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/core/config.py","lineNumber":250,"sourceCode":"        cls,\n        pyproject_path: Path = Path.cwd() / \"pyproject.toml\",\n        env: str | None = None,\n    ) -> Config:\n        \"\"\"Creates a Config instance from a TOML file.\n\n        Args:\n            pyproject_path: The path to the TOML file. Defaults to \"pyproject.toml\" in the current directory.\n            env: The environment to load the config for.\n\n        Returns:\n            Config: A Config instance with the values from the TOML file.\n\n        Raises:\n            ConfigError: If the TOML file is not found.\n\n        \"\"\"\n        if not pyproject_path.exists():\n            raise ConfigError(f\"Config file not found at {pyproject_path}.\")\n\n        try:\n            import tomllib\n        except ImportError as e:\n            raise ConfigError(\n                \"TOML support is not available. Please use Python 3.11 or later.\"\n            ) from e\n\n        with pyproject_path.open(\"rb\") as file:\n            pyproject_data = tomllib.load(file)\n            if not isinstance(pyproject_data, dict):\n                raise ConfigError(\n                    f\"Invalid TOML file format at {pyproject_path}. Expected a dictionary.\"\n                )\n            tools = pyproject_data.get(\"tool\", {})\n            if not isinstance(tools, dict):\n                raise ConfigError(\n                    f\"Invalid TOML file format at {pyproject_path}. Expected 'tool' to be a dictionary.\"","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/core/config.py#L232-L268","documentation":"ConfigError raised by CloudConfig.from_toml when the given TOML/pyproject.toml path does not exist. The CLI reads cloud settings from the [tool.reflex-cloud] section of pyproject.toml, and this error means that file is missing.","triggerScenarios":"Calling CloudConfig.from_toml(path) with a non-existent path, or a hosting command whose config resolution (from_yaml_or_toml_or_none) lands on a pyproject.toml that isn't there.","commonSituations":"Running the hosting CLI outside a Reflex project directory (no pyproject.toml present); a typo in a custom config path; the project file was renamed or deleted.","solutions":["Run the command from your project root containing pyproject.toml, or create one","Verify the path passed/derived for pyproject.toml has no typos","If you use rxconfig.yaml instead, make sure that file exists so resolution picks YAML"],"exampleFix":"# before\nconfig = CloudConfig.from_toml(Path(\"pyproject.toml\"))  # run from wrong dir\n\n# after\ncd /path/to/project && reflex deploy  # pyproject.toml present","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path(\"pyproject.toml\")\nif not p.exists():\n    raise FileNotFoundError(f\"missing {p}\")\nconfig = CloudConfig.from_toml(p)","typeGuard":null,"tryCatchPattern":"try:\n    config = CloudConfig.from_toml(p)\nexcept ConfigError as e:\n    if \"not found\" in str(e):\n        config = CloudConfig()\n    else:\n        raise","preventionTips":["Run hosting commands from the project root containing pyproject.toml","Verify the resolved config path before calling from_toml","Keep pyproject.toml under version control so it can't go missing"],"tags":["config","file-not-found","toml","reflex-hosting-cli"],"backgroundTag":"config-file-not-found","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}