{"record":{"id":"7180ea000389b92f","repo":"clockworklabs/SpacetimeDB","slug":"no-templates-found-for-selected-language","errorCode":null,"errorMessage":"No templates found for selected language","messagePattern":"No templates found for selected language","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/init.rs","lineNumber":889,"sourceCode":"        })\n        .collect();\n    lang_items.push(\"Clone from GitHub (owner/repo or git URL)\".to_string());\n    lang_items.push(\"None\".to_string());\n\n    let github_clone_index = lang_keys.len();\n    let none_index = lang_keys.len() + 1;\n    loop {\n        let client_selection = FuzzySelect::with_theme(&theme)\n            .with_prompt(\"Select a language (type to filter)\")\n            .items(&lang_items)\n            .default(0)\n            .interact()?;\n\n        if client_selection < lang_keys.len() {\n            let selected_lang = &lang_keys[client_selection];\n            let template_indices = templates_by_lang\n                .get(selected_lang)\n                .ok_or_else(|| anyhow::anyhow!(\"No templates found for selected language\"))?;\n\n            let template = if template_indices.len() > 1 {\n                let template_items: Vec<String> = template_indices\n                    .iter()\n                    .map(|&idx| {\n                        let template = &templates[idx];\n                        format!(\"{} - {}\", template.id, template.description)\n                    })\n                    .collect();\n\n                let pair_prompt = format!(\"Templates available for {selected_lang} (type to filter, Esc to go back)\");\n                let template_selection = FuzzySelect::with_theme(&theme)\n                    .with_prompt(&pair_prompt)\n                    .items(&template_items)\n                    .default(0)\n                    .interact_opt()?;\n\n                let Some(template_selection) = template_selection else {","sourceCodeStart":871,"sourceCodeEnd":907,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/init.rs#L871-L907","documentation":"During interactive init, the language/template picker is built from the template catalog embedded in the CLI binary, grouped by language. After you select a language, the template indices for it are looked up; a miss means the embedded catalog is internally inconsistent (language keys and per-language groupings out of sync) — a packaging defect in that CLI build, not something your input caused.","triggerScenarios":"Interactive `spacetime init` on a CLI build whose embedded templates.json lists languages with empty/mismatched template groups; pre-release or hand-built CLI binaries.","commonSituations":"Version skew inside a single CLI build; templates removed from the catalog while language keys remained; custom or patched CLI builds.","solutions":["Update the SpacetimeDB CLI to a stable release","Bypass the picker: `spacetime init --non-interactive --lang <lang>` or `--template <id>`","Run `spacetime init --template=` (empty value) to print the template list and pick a concrete id","If it persists on the latest release, report it with the CLI version"],"exampleFix":"# before — interactive picker hits an inconsistent catalog\nspacetime init\n\n# after — non-interactive, no catalog grouping involved\nspacetime init --non-interactive --project-name my-app --lang rust","handlingStrategy":"fallback","validationCode":"# Verify the embedded catalog has content before entering the interactive picker:\nspacetime init --template= | grep -q '^  ' \\\n  || { echo \"template catalog looks empty — update the CLI\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --lang or --template <id> in automation instead of the interactive picker","Keep the CLI on stable releases; catalog/asset inconsistencies are packaging defects fixed upstream"],"tags":["init","template-catalog","interactive","version-skew"],"backgroundTag":"empty-template-catalog","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}