{"record":{"id":"cc8a2307a736524c","repo":"denoland/deno","slug":"failed-to-publish-packages","errorCode":null,"errorMessage":"Failed to publish {} packages:","messagePattern":"Failed to publish (.+?) packages:","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/publish/mod.rs","lineNumber":1027,"sourceCode":"    }\n    Err(combine_publish_errors(errors))\n  }\n}\n\n/// Combines the errors collected while publishing multiple packages into a\n/// single error, preserving each error's context chain.\nfn combine_publish_errors(mut errors: Vec<AnyError>) -> AnyError {\n  if errors.len() == 1 {\n    return errors.remove(0);\n  }\n\n  let mut message = format!(\"Failed to publish {} packages:\", errors.len());\n  for err in &errors {\n    // `{:#}` renders the full anyhow context chain (e.g.\n    // \"Failed to publish @scope/name: <cause>\").\n    message.push_str(&format!(\"\\n\\n* {:#}\", err));\n  }\n  deno_core::anyhow::anyhow!(message)\n}\n\nasync fn publish_package(\n  http_client: &HttpClient,\n  package: Rc<PreparedPublishPackage>,\n  registry_api_url: &Url,\n  registry_url: &Url,\n  authorization: &str,\n  provenance: bool,\n) -> Result<(), AnyError> {\n  log::info!(\n    \"{} @{}/{}@{} ...\",\n    colors::intense_blue(\"Publishing\"),\n    package.scope,\n    package.package,\n    package.version\n  );\n","sourceCodeStart":1009,"sourceCodeEnd":1045,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/publish/mod.rs#L1009-L1045","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# run every per-package check (types, exports, tarball) without uploading\ndeno publish --dry-run","typeGuard":null,"tryCatchPattern":"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:\n```sh\nif ! deno publish; then\n  echo \"publish failed; see the '*' bullets above for per-package causes\" >&2\n  exit 1\nfi\n```","preventionTips":["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"],"tags":["publish","jsr","workspace","registry","diagnostics"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}