{"record":{"id":"f2a6cf637481f7aa","repo":"wasmerio/wasmer","slug":"no-template-selected","errorCode":null,"errorMessage":"No template selected","messagePattern":"No template selected","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"lib/cli/src/commands/app/create.rs","lineNumber":540,"sourceCode":"        &self,\n        client: &WasmerClient,\n    ) -> anyhow::Result<(url::Url, Option<PathBuf>)> {\n        let (mut url, selected_template): (url::Url, Option<AppTemplate>) = if let Some(template) =\n            &self.template\n        {\n            if let Ok(url) = url::Url::parse(template) {\n                (url, None)\n            } else if let Some(template) =\n                wasmer_backend_api::query::fetch_app_template_from_slug(client, template.clone())\n                    .await?\n            {\n                (url::Url::parse(&template.repo_url)?, Some(template))\n            } else {\n                anyhow::bail!(\"Template '{template}' not found in the registry\")\n            }\n        } else {\n            if self.non_interactive {\n                anyhow::bail!(\"No template selected\")\n            }\n\n            let theme = ColorfulTheme::default();\n            let registry = self\n                .env\n                .registry_public_url()?\n                .host_str()\n                .unwrap_or(\"unknown_registry\")\n                .replace('.', \"_\");\n            let cache_dir = self.env.cache_dir().join(\"templates\").join(registry);\n\n            let languages = Self::fetch_template_languages_cached(client, &cache_dir).await?;\n\n            let items = languages.iter().map(|t| t.name.clone()).collect::<Vec<_>>();\n\n            // Note: this should really use `dialoger::FuzzySelect`, but that\n            // breaks the formatting.\n            let dialog = dialoguer::Select::with_theme(&theme)","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/cli/src/commands/app/create.rs#L522-L558","documentation":"In get_template_url, if no --template value was supplied and the command is running non-interactively, the CLI cannot show the template picker, so it bails with 'No template selected'. The library throws it because choosing a template requires either a flag or interactivity.","triggerScenarios":"Running `wasmer app create --non-interactive` without --template (and not creating from a local manifest/package).","commonSituations":"CI pipelines or scripts creating template-based apps without specifying which template to use.","solutions":["Pass --template <slug> explicitly.","Drop --non-interactive to choose a template from the interactive list.","Use a local manifest (--use-local-manifest) instead of a registry template in automation."],"exampleFix":"// before\n// wasmer app create --non-interactive --owner me --name app\n// after\n// wasmer app create --non-interactive --owner me --name app --template wasmer/hello-world","handlingStrategy":"validation","validationCode":"if ((process.env.CI || !process.stdin.isTTY) && !args.template) {\n  throw new Error('--template required when running non-interactively');\n}","typeGuard":"fn has_template(args: &CreateArgs) -> bool {\n    args.template.as_deref().map(|s| !s.trim().is_empty()).unwrap_or(false)\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"No template selected\") => {\n        eprintln!(\"re-run with --template <slug>\");\n        std::process::exit(2);\n    }\n    other => other?,\n}","preventionTips":["Always pass --template in non-interactive/CI runs.","Enumerate required flags (owner, name, template) whenever --non-interactive is used.","Prefer local manifests for fully offline/automated scaffolding."],"tags":["wasmer","cli","app-create","non-interactive"],"backgroundTag":"missing-required-cli-argument","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}