Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion crates/wasm-pkg-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,18 @@ fn resolve_package(
})?;

let version = version.ok_or_else(|| {
crate::Error::InvalidComponent(anyhow::anyhow!("component package version not found"))
crate::Error::InvalidComponent(anyhow::anyhow!(
"component package version not found in the Wasm binary\n\
\n\
The Wasm file was built without a version in the WIT `package` statement.\n\
Add a version to the `package` statement in your .wit file, e.g.:\n\
\n\
\tpackage example:my-package@1.0.0;\n\
\n\
Alternatively, specify the package and version explicitly with the --package flag:\n\
\n\
\twkg publish <file> --package <namespace>:<name>@<version>"
))
})?;
Ok((data.into_inner(), package, version))
}