{"record":{"id":"42f45825fe35bd2b","repo":"clockworklabs/SpacetimeDB","slug":"client-template-not-found","errorCode":null,"errorMessage":"Client template not found: {}","messagePattern":"Client template not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/init.rs","lineNumber":1391,"sourceCode":"    dotnet_major: Option<u8>,\n) -> anyhow::Result<()> {\n    let template_def = config\n        .template_def\n        .as_ref()\n        .ok_or_else(|| anyhow::anyhow!(\"Template definition missing\"))?;\n\n    let template_files = embedded::get_template_files();\n\n    if !is_server_only {\n        println!(\n            \"Setting up client ({})...\",\n            config.client_lang.map(|l| l.as_str()).unwrap_or(\"none\")\n        );\n        let client_source = &template_def.client_source;\n        if let Some(files) = template_files.get(client_source.as_str()) {\n            copy_embedded_files(files, project_path)?;\n        } else {\n            anyhow::bail!(\"Client template not found: {}\", client_source);\n        }\n\n        // Update client name\n        match config.client_lang {\n            Some(ClientLanguage::TypeScript) => {\n                update_package_json(project_path, &config.project_name)?;\n                write_typescript_client_env_file(project_path, &config.project_name, config.use_local)?;\n                println!(\n                    \"{}\",\n                    \"Note: Run 'npm install' in the project directory to install dependencies\".yellow()\n                );\n            }\n            Some(ClientLanguage::Rust) => {\n                update_cargo_toml_name(project_path, &config.project_name)?;\n            }\n            Some(ClientLanguage::Csharp) => {\n                update_csproj_client_to_nuget(project_path)?;\n            }","sourceCodeStart":1373,"sourceCodeEnd":1409,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/init.rs#L1373-L1409","documentation":"Builtin template file sets are embedded in the CLI binary, keyed by the catalog's `client_source` name. When scaffolding the client half of a project, init looks up that key in the embedded files; if the key is absent — the catalog references a source directory this build never embedded — init aborts. It signals version skew between the embedded catalog and the embedded template assets within one CLI build.","triggerScenarios":"A CLI build whose templates.json advertises a client_source that has no matching entry in the embedded file sets; templates renamed on one side but not the other; custom/patched builds.","commonSituations":"Pre-release or mismatched CLI builds; templates added to the catalog after the embedded assets were frozen.","solutions":["Update the SpacetimeDB CLI so the embedded catalog and assets match","Pick a different template or scaffold by `--lang`","Clone the template repo manually (`git clone https://github.com/owner/repo`) and adapt it","If it persists on the latest release, report it with the template id and CLI version"],"exampleFix":"# before — embedded client assets missing for this template\nspacetime init my-app --non-interactive --template fullstack-ts\n\n# after — update CLI, or fall back to language scaffolding\nspacetime update\nspacetime init my-app --non-interactive --project-name my-app --lang typescript","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Update the CLI when template errors appear — embedded catalog/assets skew is fixed upstream","Pin a known-good CLI version in CI","If scaffolding fails partway, clean the project directory before retrying to avoid mixed states"],"tags":["init","template","embedded-assets","version-skew"],"backgroundTag":"template-asset-missing","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}