denoland/deno · error
Failed to publish {} packages:
Error message
Failed to publish {} packages: What it means
Thrown by `deno publish` when a workspace publish finishes with two or more failed member packages. Publishing does not stop at the first failure: every package is attempted, each error is collected, and `combine_publish_errors` merges them into this summary while preserving each error's full context chain. The real cause is never this line itself; it is one of the per-package errors listed as `*` bullets underneath.
Source
Thrown at cli/tools/publish/mod.rs:1027
}
Err(combine_publish_errors(errors))
}
}
/// Combines the errors collected while publishing multiple packages into a
/// single error, preserving each error's context chain.
fn combine_publish_errors(mut errors: Vec<AnyError>) -> AnyError {
if errors.len() == 1 {
return errors.remove(0);
}
let mut message = format!("Failed to publish {} packages:", errors.len());
for err in &errors {
// `{:#}` renders the full anyhow context chain (e.g.
// "Failed to publish @scope/name: <cause>").
message.push_str(&format!("\n\n* {:#}", err));
}
deno_core::anyhow::anyhow!(message)
}
async fn publish_package(
http_client: &HttpClient,
package: Rc<PreparedPublishPackage>,
registry_api_url: &Url,
registry_url: &Url,
authorization: &str,
provenance: bool,
) -> Result<(), AnyError> {
log::info!(
"{} @{}/{}@{} ...",
colors::intense_blue("Publishing"),
package.scope,
package.package,
package.version
);
View on GitHub (pinned to 89f33cbef2)
Solutions
- Read each `*` bullet under the summary — the actual failure is a nested per-package error such as 'Failed to publish @scope/pkg: <cause>'
- Fix the per-package causes (slow types, exports, auth, version) and re-check with `deno publish --dry-run`
- If versions already exist on jsr.io, bump the `version` field in each affected member's deno.json and publish again
- Confirm publish authentication is valid and jsr.io is reachable from the machine
Defensive patterns
Strategy: validation
Validate before calling
# run every per-package check (types, exports, tarball) without uploading deno publish --dry-run
Try / catch
In CI scripts, treat any non-zero exit from `deno publish` as failure and keep stderr intact — the per-package causes are the `*` bullets inside the combined message: ```sh if ! deno publish; then echo "publish failed; see the '*' bullets above for per-package causes" >&2 exit 1 fi ```
Prevention
- Run `deno publish --dry-run` in CI before the real publish step
- Bump versions in the same commit that changes member code so siblings do not fail on already-published versions
- Keep workspace members type-clean (no slow types) so one bad member does not cascade into the combined error
When it happens
Trigger: `deno publish` in a multi-member workspace where at least two packages fail independently: slow-types diagnostics in one member plus a registry rejection (auth, version already exists, scope mismatch) in another, or several members all failing the same no-slow-types rule.
Common situations: Monorepo publishing with an expired or missing JSR token; a workspace where many members fail type checks at once; one member already published at the current version while a sibling fails; network problems interrupting multiple uploads in the same run.
Related errors
- Export {} not found in the package
- unable to find npm package in workspace
- missing version in package.json of npm package
- Found {} problem{}
- {} is missing 'version' field
AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16).
Data as JSON: /api/errors/cc8a2307a736524c.
Report an issue: GitHub.