{"record":{"id":"9ae980ecb8e82653","repo":"clockworklabs/SpacetimeDB","slug":"server-template-not-found","errorCode":null,"errorMessage":"Server template not found: {}","messagePattern":"Server template not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/init.rs","lineNumber":1427,"sourceCode":"                update_cargo_toml_name(project_path, &config.project_name)?;\n            }\n            Some(ClientLanguage::Csharp) => {\n                update_csproj_client_to_nuget(project_path)?;\n            }\n            None => {}\n        }\n    }\n\n    println!(\n        \"Setting up server ({})...\",\n        config.server_lang.map(|l| l.as_str()).unwrap_or(\"none\")\n    );\n    let server_dir = project_path.join(\"spacetimedb\");\n    let server_source = &template_def.server_source;\n    if let Some(files) = template_files.get(server_source.as_str()) {\n        copy_embedded_files(files, &server_dir)?;\n    } else {\n        anyhow::bail!(\"Server template not found: {}\", server_source);\n    }\n\n    // Update server name\n    match config.server_lang {\n        Some(ServerLanguage::TypeScript) => {\n            update_package_json(&server_dir, &config.project_name)?;\n        }\n        Some(ServerLanguage::Rust) => {\n            update_cargo_toml_name(&server_dir, &config.project_name)?;\n        }\n        Some(ServerLanguage::Csharp) => {\n            update_csproj_server_to_nuget(&server_dir)?;\n        }\n        Some(ServerLanguage::Cpp) => {\n            // No name update needed for C++ at the moment\n        }\n        None => {}\n    }","sourceCodeStart":1409,"sourceCodeEnd":1445,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/fdd647dfac506d0967cc4492e9fce380706c94cb/crates/cli/src/subcommands/init.rs#L1409-L1445","documentation":"Same invariant as the client case, but for the module side: the template definition's server_source key has no matching entry among the template files embedded in the CLI binary. Generation stops before writing `spacetimedb/`. Internal inconsistency, not a user config error.","triggerScenarios":"Custom/forked CLI where a template def's server_source key is not embedded; templates directory renamed without updating defs; mixing binary versions.","commonSituations":"Forked CLI development; template refactors; docs describing a template newer than the installed binary.","solutions":["Fall back to a stock template or `--lang rust`/`--lang csharp` to generate the server","Reinstall the latest official CLI so embedded templates match the definitions","Building from source: ensure templates/<server_source> exists and rebuild","File an issue including the exact template name"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["When building the CLI from source, keep template defs and the templates/ directory in one commit","Verify with `spacetime init --template ''` that the template list renders before relying on it"],"tags":["spacetime-init","template","embedded-assets","cli","module"],"backgroundTag":"template-not-found","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"}