Description
CSS styling intermittently stops loading during hot reload in the dev server. The page renders without any styling (raw HTML structure visible). Restarting bengal serve fixes the issue.
Repro steps
- Start dev server:
uv run bengal serve
- Make changes to content files (e.g., edit markdown)
- After an incremental rebuild, CSS stops loading
- Browser shows unstyled page (no CSS applied)
- Kill and restart
bengal serve - styling works again
Expected
CSS should remain loaded and functional throughout all incremental rebuilds.
Actual
After some incremental rebuilds, CSS stops being served/loaded. The page renders but without any styling.
Environment
- Bengal version: 0.1.8
- Python version: 3.14
- OS: macOS
Investigation notes
Looked at the codebase and found potential causes:
-
Asset discovery skip logic (bengal/orchestration/content.py:580-599): During incremental builds when only content files change, asset discovery is skipped and cached asset data is used. This might cause CSS bundling to not be re-triggered.
-
Output asset detection thresholds (bengal/orchestration/build/provenance_filter.py:235-249): The check len(list(output_assets_dir.iterdir())) < 3 may be too low to detect when CSS needs rebuilding.
-
Theme asset check (bengal/orchestration/build/rendering.py:268-281): Uses arbitrary threshold < 5 files to determine if theme assets need processing.
Workaround
Restart bengal serve when styling breaks.
Description
CSS styling intermittently stops loading during hot reload in the dev server. The page renders without any styling (raw HTML structure visible). Restarting
bengal servefixes the issue.Repro steps
uv run bengal servebengal serve- styling works againExpected
CSS should remain loaded and functional throughout all incremental rebuilds.
Actual
After some incremental rebuilds, CSS stops being served/loaded. The page renders but without any styling.
Environment
Investigation notes
Looked at the codebase and found potential causes:
Asset discovery skip logic (
bengal/orchestration/content.py:580-599): During incremental builds when only content files change, asset discovery is skipped and cached asset data is used. This might cause CSS bundling to not be re-triggered.Output asset detection thresholds (
bengal/orchestration/build/provenance_filter.py:235-249): The checklen(list(output_assets_dir.iterdir())) < 3may be too low to detect when CSS needs rebuilding.Theme asset check (
bengal/orchestration/build/rendering.py:268-281): Uses arbitrary threshold< 5files to determine if theme assets need processing.Workaround
Restart
bengal servewhen styling breaks.