{"record":{"id":"d12982bf8460e28b","repo":"reflex-dev/reflex","slug":"the-stylesheet-file-stylesheet-full-path-does-no","errorCode":null,"errorMessage":"The stylesheet file {stylesheet_full_path} does not exist.","messagePattern":"The stylesheet file (.+?) does not exist\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"reflex/compiler/compiler.py","lineNumber":365,"sourceCode":"    active_plugins = get_config().plugins if plugins is None else plugins\n    sheets.extend([\n        sheet for plugin in active_plugins for sheet in plugin.get_stylesheet_paths()\n    ])\n\n    failed_to_import_sass = False\n    assets_app_path = Path.cwd() / constants.Dirs.APP_ASSETS\n\n    stylesheets_files: list[Path] = []\n    stylesheets_urls = []\n\n    for stylesheet in stylesheets:\n        if not utils.is_valid_url(stylesheet):\n            # check if stylesheet provided exists.\n            stylesheet_full_path = assets_app_path / stylesheet.strip(\"/\")\n\n            if not stylesheet_full_path.exists():\n                msg = f\"The stylesheet file {stylesheet_full_path} does not exist.\"\n                raise FileNotFoundError(msg)\n\n            if stylesheet_full_path.is_dir():\n                all_files = (\n                    file\n                    for ext in constants.Reflex.STYLESHEETS_SUPPORTED\n                    for file in stylesheet_full_path.rglob(\"*.\" + ext)\n                )\n                for file in all_files:\n                    if file.is_dir():\n                        continue\n                    # Validate the stylesheet.\n                    _validate_stylesheet(file, assets_app_path)\n                    stylesheets_files.append(file)\n\n            else:\n                # Validate the stylesheet.\n                _validate_stylesheet(stylesheet_full_path, assets_app_path)\n                stylesheets_files.append(stylesheet_full_path)","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/reflex/compiler/compiler.py#L347-L383","documentation":"Each non-URL stylesheet listed in add_styles must exist under the app's assets directory at compile time; Reflex needs to read (and for directories, rglob) the file(s) to inline them into the compiled root stylesheet. A missing file raises FileNotFoundError.","triggerScenarios":"rx.App(add_styles=[\"/css/theme.css\"]) where assets/css/theme.css does not exist — typo'd name, wrong subdirectory, or file never committed. Also triggered when a directory entry matches no supported stylesheet files inside it.","commonSituations":"Renaming/moving CSS files without updating App config; assets excluded by .gitignore so teammates/CI hit it; case-mismatch of the filename across operating systems.","solutions":["Create or commit the file at the exact path shown in the error message","Correct the path/subdirectory in the add_styles entry","Check .gitignore rules if the file exists locally but fails in CI/other checkouts"],"exampleFix":"# before\napp = rx.App(add_styles=[\"/css/theme.css\"])  # file actually at assets/styles/theme.css\n# after\napp = rx.App(add_styles=[\"/styles/theme.css\"])","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef validate_stylesheet_files(styles: list[str], assets_dir: Path) -> list[str]:\n    for s in styles:\n        if s.startswith((\"http://\", \"https://\")):\n            continue\n        p = assets_dir / s.strip(\"/\")\n        if not p.exists():\n            raise FileNotFoundError(f\"stylesheet not found: {p}\")\n    return styles\n\napp = rx.App(add_styles=validate_stylesheet_files(my_styles, Path(\".web/assets\")))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a smoke test that asserts every add_styles entry exists under assets/","Don't gitignore *.css in the assets directory","Double-check case and subdirectory of each stylesheet path"],"tags":["reflex","stylesheets","file-not-found","compilation"],"backgroundTag":"file-not-found","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}