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

  1. Update the SpacetimeDB CLI to the latest version so the catalog and parser agree
  2. Choose a different template or use `--lang` instead of `--template`
  3. 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

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


AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16). Data as JSON: /api/errors/71e8cfab8d3e873e. Report an issue: GitHub.