{"record":{"id":"6f26993b53c2e6f5","repo":"reflex-dev/reflex","slug":"stylesheet-file-stylesheet-full-path-is-not-supp","errorCode":null,"errorMessage":"Stylesheet file {stylesheet_full_path} is not supported.","messagePattern":"Stylesheet file (.+?) is not supported\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"reflex/compiler/compiler.py","lineNumber":300,"sourceCode":"\n    return output_path, code\n\n\ndef _validate_stylesheet(stylesheet_full_path: Path, assets_app_path: Path) -> None:\n    \"\"\"Validate the stylesheet.\n\n    Args:\n        stylesheet_full_path: The stylesheet to validate.\n        assets_app_path: The path to the assets directory.\n\n    Raises:\n        ValueError: If the stylesheet is not supported.\n        FileNotFoundError: If the stylesheet is not found.\n    \"\"\"\n    suffix = stylesheet_full_path.suffix[1:] if stylesheet_full_path.suffix else \"\"\n    if suffix not in constants.Reflex.STYLESHEETS_SUPPORTED:\n        msg = f\"Stylesheet file {stylesheet_full_path} is not supported.\"\n        raise ValueError(msg)\n    if not stylesheet_full_path.absolute().is_relative_to(assets_app_path.absolute()):\n        msg = f\"Cannot include stylesheets from outside the assets directory: {stylesheet_full_path}\"\n        raise FileNotFoundError(msg)\n    if not stylesheet_full_path.name:\n        msg = f\"Stylesheet file name cannot be empty: {stylesheet_full_path}\"\n        raise ValueError(msg)\n    if (\n        len(\n            stylesheet_full_path\n            .absolute()\n            .relative_to(assets_app_path.absolute())\n            .parts\n        )\n        == 1\n        and stylesheet_full_path.stem == PageNames.STYLESHEET_ROOT\n    ):\n        msg = f\"Stylesheet file name cannot be '{PageNames.STYLESHEET_ROOT}': {stylesheet_full_path}\"\n        raise ValueError(msg)","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/reflex/compiler/compiler.py#L282-L318","documentation":"During compilation of the root stylesheet, Reflex validates each non-URL stylesheet referenced in rx.App(add_styles=[...]) or theme styles. Only files with extensions in Reflex.STYLESHEETS_SUPPORTED (css, scss, sass) are allowed; anything else raises this ValueError.","triggerScenarios":"Adding a stylesheet entry whose file extension is not .css/.scss/.sass, e.g. rx.App(add_styles=[\"/styles/main.less\", \"/styles/style.styl\"]), or omitting/misspelling the extension so suffix is empty. Valid URLs (http/https) skip this validation.","commonSituations":"Porting an app from another framework that used Less/Stylus; typo in the extension (\".cs\" or no extension); assuming arbitrary stylesheet formats are passed through to the bundler.","solutions":["Convert the file to .css or .scss (sass is also supported) and update the path","If it's a URL, pass the full http(s):// URL so it bypasses file validation","Fix the extension typo in the add_styles entry"],"exampleFix":"# before\napp = rx.App(add_styles=[\"/styles/theme.less\"])\n# after\napp = rx.App(add_styles=[\"/styles/theme.scss\"])","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nSUPPORTED = {\"css\", \"scss\", \"sass\"}\n\ndef validate_styles(styles: list[str]) -> list[str]:\n    out = []\n    for s in styles:\n        if s.startswith((\"http://\", \"https://\")):\n            out.append(s)\n        elif Path(s).suffix.lstrip(\".\").lower() not in SUPPORTED:\n            raise ValueError(f\"unsupported stylesheet extension: {s}\")\n        else:\n            out.append(s)\n    return out\n\napp = rx.App(add_styles=validate_styles(my_styles))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only .css/.scss/.sass for local stylesheets","Use full URLs for CDN styles","Check the constant reflex.constants.Reflex.STYLESHEETS_SUPPORTED when upgrading Reflex"],"tags":["reflex","stylesheets","compilation","value-error"],"backgroundTag":"unsupported-file-format","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}