clockworklabs/SpacetimeDB · error · anyhow::Error
Unknown client language: {}
Error message
Unknown client language: {} What it means
The client language parser accepts only `rust`, `csharp`, `c#`, and `typescript` (case-insensitive) — there is no C++ client option. Unlike the server language, this value is parsed from the template catalog's `client_lang` metadata embedded in the CLI, not from your command line, so hitting it means the embedded catalog entry references a client language this CLI build does not know.
Source
Thrown at crates/cli/src/subcommands/init.rs:106
Csharp,
TypeScript,
}
impl ClientLanguage {
fn as_str(&self) -> &'static str {
match self {
ClientLanguage::Rust => "rust",
ClientLanguage::Csharp => "csharp",
ClientLanguage::TypeScript => "typescript",
}
}
fn from_str(s: &str) -> anyhow::Result<Option<Self>> {
match s.to_lowercase().as_str() {
"rust" => Ok(Some(ClientLanguage::Rust)),
"csharp" | "c#" => Ok(Some(ClientLanguage::Csharp)),
"typescript" => Ok(Some(ClientLanguage::TypeScript)),
_ => Err(anyhow!("Unknown client language: {}", s)),
}
}
}
pub struct TemplateConfig {
pub project_name: String,
pub project_path: PathBuf,
pub template_type: TemplateType,
pub server_lang: Option<ServerLanguage>,
pub client_lang: Option<ClientLanguage>,
pub github_repo: Option<String>,
pub template_def: Option<TemplateDefinition>,
pub use_local: bool,
pub native_aot: bool,
}
#[derive(Debug, Clone, Default)]
pub struct InitOptions {View on GitHub (pinned to 524b4487d9)
Solutions
- Update the SpacetimeDB CLI to the latest version so the catalog and parser agree
- Choose a different template or use `--lang` instead of `--template`
- If it persists on the latest release, report it with the template id and CLI version
Example fix
# before — template catalog references an unknown client language spacetime init my-app --non-interactive --template quickstart-new # after — update CLI, then scaffold by language instead spacetime update && spacetime init my-app --non-interactive --lang rust
Defensive patterns
Strategy: fallback
Validate before calling
# List the catalog your CLI actually knows, then pick a template id from it: spacetime init --template= # prints 'Available templates:' — choose from this list only
Type guard
// Rust: matches init's ClientLanguage::from_str acceptance set.
fn is_supported_client_lang(s: &str) -> bool {
matches!(
s.trim().to_lowercase().as_str(),
"rust" | "csharp" | "c#" | "typescript"
)
} Prevention
- The client language comes from the template catalog embedded in the CLI — keep the CLI updated rather than working around parse errors
- Pin a known-good CLI version in CI so catalog/parser mismatches can't appear mid-pipeline
- Prefer --lang over --template when you only need a supported language scaffold
When it happens
Trigger: Selecting a template whose catalog entry lists a `client_lang` outside {rust, csharp, c#, typescript} — e.g. a template defined for a newer CLI; a CLI build where templates.json and the ClientLanguage enum went out of sync.
Common situations: Pre-release or mismatched CLI builds; templates added to the catalog after your CLI was built; custom template catalogs injected into a build.
Related errors
- No templates found for selected language
- Unknown server language: {}
- Template definition missing
- Client template not found: {}
- Server template not found: {}
AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16).
Data as JSON: /api/errors/71e8cfab8d3e873e.
Report an issue: GitHub.