Summary
sm new generates templates/index.html at the project root, but simple_module_hosting._inertia_setup only looks for <project_root>/host/templates. With the scaffold's default layout, the host has no usable template directory and boot fails with RuntimeError: Inertia not configured — no template directories available.
Reproduction
uvx --from simple_module_cli sm new my-app --db sqlite --preset standard -y --no-install
cd my-app
# (after working around #105/#106/#107)
make install
make migrate
uv run python -c "from main import app"
Boot output:
WARNING simple_module_hosting._inertia_setup: Host templates directory not found at /.../my-app/host/templates
WARNING simple_module_hosting._inertia_setup: No usable template directories — Inertia will fail to render views
...
File ".../site-packages/simple_module_hosting/app_builder.py", line 258, in create_app
raise RuntimeError("Inertia not configured — no template directories available")
RuntimeError: Inertia not configured — no template directories available
Source reference
simple_module_hosting/_inertia_setup.py:35
host_templates=project_root/"host"/"templates"
...
ifhost_templates.is_dir():
directories.append(host_templates)
else:
logger.warning("Host templates directory not found at %s", host_templates)Scaffold output (actual layout)
my-app/
├── client_app/
├── main.py
├── migrations/
├── templates/ ← scaffold writes here
│ └── index.html
└── ...
Suggested fix
One of:
- Have
sm new write the template to host/templates/index.html to match what the framework looks up. - Have
_inertia_setup accept root templates/ as a fallback (less surprising to anyone reading the project layout — host/templates is an unusual location). - Make the host templates path configurable via
SM_HOST_TEMPLATES_DIR and document it.
Workaround
mkdir -p host
mv templates host/templates
Environment
simple_module_cli, simple_module_hosting 0.0.6- macOS 25.4.0 (arm64), Python 3.12.10
Summary
sm newgeneratestemplates/index.htmlat the project root, butsimple_module_hosting._inertia_setuponly looks for<project_root>/host/templates. With the scaffold's default layout, the host has no usable template directory and boot fails withRuntimeError: Inertia not configured — no template directories available.Reproduction
Boot output:
Source reference
simple_module_hosting/_inertia_setup.py:35Scaffold output (actual layout)
Suggested fix
One of:
sm newwrite the template tohost/templates/index.htmlto match what the framework looks up._inertia_setupaccept roottemplates/as a fallback (less surprising to anyone reading the project layout —host/templatesis an unusual location).SM_HOST_TEMPLATES_DIRand document it.Workaround
Environment
simple_module_cli,simple_module_hosting0.0.6