{"record":{"id":"b9ca4fb3cf290975","repo":"wasmerio/wasmer","slug":"the-use-local-manifest-flag-was-passed-but-path","errorCode":null,"errorMessage":"The --use_local_manifest flag was passed, but path {} does not contain a valid package manifest.","messagePattern":"The --use_local_manifest flag was passed, but path (.+?) does not contain a valid package manifest\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"lib/cli/src/commands/app/create.rs","lineNumber":277,"sourceCode":"        owner: &str,\n        app_name: &str,\n    ) -> anyhow::Result<bool> {\n        if (!self.use_local_manifest && self.non_interactive)\n            || self.template.is_some()\n            || self.package.is_some()\n        {\n            return Ok(false);\n        }\n\n        let app_dir = match &self.app_dir_path {\n            Some(dir) => PathBuf::from(dir),\n            None => std::env::current_dir()?,\n        };\n\n        let (manifest_path, _) = if let Some(res) = load_package_manifest(&app_dir)? {\n            res\n        } else if self.use_local_manifest {\n            anyhow::bail!(\n                \"The --use_local_manifest flag was passed, but path {} does not contain a valid package manifest.\",\n                app_dir.display()\n            )\n        } else {\n            return Ok(false);\n        };\n\n        let ask_confirmation = || {\n            eprintln!(\n                \"A package manifest was found in path {}.\",\n                &manifest_path.display()\n            );\n            let theme = dialoguer::theme::ColorfulTheme::default();\n            Confirm::with_theme(&theme)\n                .with_prompt(\"Use it for the app?\")\n                .interact()\n        };\n","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/cli/src/commands/app/create.rs#L259-L295","documentation":"When --use-local-manifest is passed, `wasmer app create` expects the app directory to contain a valid package manifest (wasmer.toml/Cargo.toml-derived). If load_package_manifest returns None and the flag was set, it bails. The library throws it because the flag explicitly promises a local manifest that does not exist.","triggerScenarios":"Running `wasmer app create --use-local-manifest` in (or with --dir pointing to) a directory lacking a loadable package manifest.","commonSituations":"Wrong working directory; manifest named/located incorrectly; forgetting to run in the package root; manifest parse failure upstream resulting in None.","solutions":["Run the command from the directory containing a valid wasmer.toml (or add one).","Remove --use-local-manifest to let the CLI fall back to creating from a package/template.","Fix the manifest (validate wasmer.toml syntax and required fields)."],"exampleFix":"// before\n// wasmer app create --use-local-manifest   (no wasmer.toml here)\n// after\n// cd path/with/wasmer.toml && wasmer app create --use-local-manifest\n// (or drop the flag)","handlingStrategy":"validation","validationCode":"if (args.useLocalManifest && !fs.existsSync('wasmer.toml')) {\n  throw new Error('--use-local-manifest set but no wasmer.toml in cwd');\n}","typeGuard":"fn has_local_manifest(dir: &Path) -> bool {\n    dir.join(\"wasmer.toml\").is_file()\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"--use_local_manifest\") || e.to_string().contains(\"use_local_manifest\") => {\n        eprintln!(\"no manifest found; re-run without the flag or from package root\");\n    }\n    other => other?,\n}","preventionTips":["Run app create from the package root containing wasmer.toml.","Only pass --use-local-manifest when a valid manifest is present.","Validate wasmer.toml parses before invoking the command."],"tags":["wasmer","cli","manifest","app-create"],"backgroundTag":"missing-package-manifest","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}