wasmerio/wasmer · error · anyhow::Error
The --use_local_manifest flag was passed, but path {} does n
Error message
The --use_local_manifest flag was passed, but path {} does not contain a valid package manifest. What it means
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.
Source
Thrown at lib/cli/src/commands/app/create.rs:277
owner: &str,
app_name: &str,
) -> anyhow::Result<bool> {
if (!self.use_local_manifest && self.non_interactive)
|| self.template.is_some()
|| self.package.is_some()
{
return Ok(false);
}
let app_dir = match &self.app_dir_path {
Some(dir) => PathBuf::from(dir),
None => std::env::current_dir()?,
};
let (manifest_path, _) = if let Some(res) = load_package_manifest(&app_dir)? {
res
} else if self.use_local_manifest {
anyhow::bail!(
"The --use_local_manifest flag was passed, but path {} does not contain a valid package manifest.",
app_dir.display()
)
} else {
return Ok(false);
};
let ask_confirmation = || {
eprintln!(
"A package manifest was found in path {}.",
&manifest_path.display()
);
let theme = dialoguer::theme::ColorfulTheme::default();
Confirm::with_theme(&theme)
.with_prompt("Use it for the app?")
.interact()
};
View on GitHub (pinned to 8c4b9ee9d3)
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).
Example fix
// before // wasmer app create --use-local-manifest (no wasmer.toml here) // after // cd path/with/wasmer.toml && wasmer app create --use-local-manifest // (or drop the flag)
Defensive patterns
Strategy: validation
Validate before calling
if (args.useLocalManifest && !fs.existsSync('wasmer.toml')) {
throw new Error('--use-local-manifest set but no wasmer.toml in cwd');
} Type guard
fn has_local_manifest(dir: &Path) -> bool {
dir.join("wasmer.toml").is_file()
} Try / catch
match result {
Err(e) if e.to_string().contains("--use_local_manifest") || e.to_string().contains("use_local_manifest") => {
eprintln!("no manifest found; re-run without the flag or from package root");
}
other => other?,
} Prevention
- 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.
When it happens
Trigger: Running `wasmer app create --use-local-manifest` in (or with --dir pointing to) a directory lacking a loadable package manifest.
Common situations: Wrong working directory; manifest named/located incorrectly; forgetting to run in the package root; manifest parse failure upstream resulting in None.
Related errors
- Stopping as the directory is not empty
- No template selected
- Cannot create app from template in offline mode
- No app name specified: use --name <app_name>
- No owner specified: use --owner <owner>
AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01).
Data as JSON: /api/errors/b9ca4fb3cf290975.
Report an issue: GitHub.