reflex-dev/reflex · error · ValueError
Stylesheet file {stylesheet_full_path} is not supported.
Error message
Stylesheet file {stylesheet_full_path} is not supported. What it means
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.
Source
Thrown at reflex/compiler/compiler.py:300
return output_path, code
def _validate_stylesheet(stylesheet_full_path: Path, assets_app_path: Path) -> None:
"""Validate the stylesheet.
Args:
stylesheet_full_path: The stylesheet to validate.
assets_app_path: The path to the assets directory.
Raises:
ValueError: If the stylesheet is not supported.
FileNotFoundError: If the stylesheet is not found.
"""
suffix = stylesheet_full_path.suffix[1:] if stylesheet_full_path.suffix else ""
if suffix not in constants.Reflex.STYLESHEETS_SUPPORTED:
msg = f"Stylesheet file {stylesheet_full_path} is not supported."
raise ValueError(msg)
if not stylesheet_full_path.absolute().is_relative_to(assets_app_path.absolute()):
msg = f"Cannot include stylesheets from outside the assets directory: {stylesheet_full_path}"
raise FileNotFoundError(msg)
if not stylesheet_full_path.name:
msg = f"Stylesheet file name cannot be empty: {stylesheet_full_path}"
raise ValueError(msg)
if (
len(
stylesheet_full_path
.absolute()
.relative_to(assets_app_path.absolute())
.parts
)
== 1
and stylesheet_full_path.stem == PageNames.STYLESHEET_ROOT
):
msg = f"Stylesheet file name cannot be '{PageNames.STYLESHEET_ROOT}': {stylesheet_full_path}"
raise ValueError(msg)View on GitHub (pinned to 45b8ed5ab7)
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
Example fix
# before app = rx.App(add_styles=["/styles/theme.less"]) # after app = rx.App(add_styles=["/styles/theme.scss"])
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
SUPPORTED = {"css", "scss", "sass"}
def validate_styles(styles: list[str]) -> list[str]:
out = []
for s in styles:
if s.startswith(("http://", "https://")):
out.append(s)
elif Path(s).suffix.lstrip(".").lower() not in SUPPORTED:
raise ValueError(f"unsupported stylesheet extension: {s}")
else:
out.append(s)
return out
app = rx.App(add_styles=validate_styles(my_styles)) Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Cannot include stylesheets from outside the assets directory
- Stylesheet file name cannot be '{PageNames.STYLESHEET_ROOT}'
- The stylesheet file {stylesheet_full_path} does not exist.
- OTP field `length` must be a positive integer.
- Stylesheet file name cannot be empty: {stylesheet_full_path}
AI-assisted analysis of reflex-dev/reflex@45b8ed5ab7 (2026-08-28).
Data as JSON: /api/errors/6f26993b53c2e6f5.
Report an issue: GitHub.