{"record":{"id":"71e8cfab8d3e873e","repo":"clockworklabs/SpacetimeDB","slug":"unknown-client-language","errorCode":null,"errorMessage":"Unknown client language: {}","messagePattern":"Unknown client language: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/init.rs","lineNumber":106,"sourceCode":"    Csharp,\n    TypeScript,\n}\n\nimpl ClientLanguage {\n    fn as_str(&self) -> &'static str {\n        match self {\n            ClientLanguage::Rust => \"rust\",\n            ClientLanguage::Csharp => \"csharp\",\n            ClientLanguage::TypeScript => \"typescript\",\n        }\n    }\n\n    fn from_str(s: &str) -> anyhow::Result<Option<Self>> {\n        match s.to_lowercase().as_str() {\n            \"rust\" => Ok(Some(ClientLanguage::Rust)),\n            \"csharp\" | \"c#\" => Ok(Some(ClientLanguage::Csharp)),\n            \"typescript\" => Ok(Some(ClientLanguage::TypeScript)),\n            _ => Err(anyhow!(\"Unknown client language: {}\", s)),\n        }\n    }\n}\n\npub struct TemplateConfig {\n    pub project_name: String,\n    pub project_path: PathBuf,\n    pub template_type: TemplateType,\n    pub server_lang: Option<ServerLanguage>,\n    pub client_lang: Option<ClientLanguage>,\n    pub github_repo: Option<String>,\n    pub template_def: Option<TemplateDefinition>,\n    pub use_local: bool,\n    pub native_aot: bool,\n}\n\n#[derive(Debug, Clone, Default)]\npub struct InitOptions {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/fdd647dfac506d0967cc4492e9fce380706c94cb/crates/cli/src/subcommands/init.rs#L88-L124","documentation":"Client-language counterpart of the server-language parser in `spacetime init`. ClientLanguage::from_str accepts only rust, csharp (alias c#), and typescript — note there is NO cpp/client option, and values like 'unrealcpp', 'javascript', or 'ts' are rejected with 'Unknown client language: <s>'.","triggerScenarios":"Passing `spacetime init --client-lang <s>` with a value outside {rust, csharp, c#, typescript}. Common misses: 'ts' (not an alias), 'javascript' (not an alias), 'unrealcpp' (not a client language for init templates).","commonSituations":"Mapping 'typescript'→'ts' out of habit; Unity/Unreal developers trying 'unrealcpp' as a client language; scripts sharing one language variable between server and client flags where the server accepts cpp but the client parser does not.","solutions":["Use exactly rust, csharp (or c#), or typescript","If you need Unreal C++ client bindings, init with a supported client language (or none) and run `spacetime generate --lang unrealcpp` separately","Normalize values in automation: lowercase, expand 'ts'→'typescript'"],"exampleFix":"# before\nspacetime init --client-lang ts\n# after\nspacetime init --client-lang typescript","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nCLIENT_LANGS='rust|csharp|c#|typescript'\nlang=\"$(echo \"$1\" | tr '[:upper:]' '[:lower:]' | xargs)\"\n[[ \"$lang\" =~ ^($CLIENT_LANGS)$ ]] || { echo \"client lang must be: $CLIENT_LANGS (no ts/javascript/unrealcpp)\" >&2; exit 2; }\nspacetime init --client-lang \"$lang\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Client languages are a smaller set than server languages — 'ts' and 'unrealcpp' are NOT accepted","For Unreal client bindings, init without them and run `spacetime generate --lang unrealcpp` separately","Don't reuse one shell variable for both --lang and --client-lang; their accepted sets differ"],"tags":["cli","init","arguments","language","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"fdd647dfac506d0967cc4492e9fce380706c94cb","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}