{"record":{"id":"a7fc240fc02a4a67","repo":"denoland/deno","slug":"export-not-found-in-the-package","errorCode":null,"errorMessage":"Export {} not found in the package","messagePattern":"Export (.+?) not found in the package","errorType":"exception","errorClass":"AnyError","httpStatus":null,"severity":"error","filePath":"cli/tools/publish/mod.rs","lineNumber":1501,"sourceCode":"      .find(|f| f.path_str == path.as_str());\n\n    if let Some(file) = file {\n      if file.hash != entry.checksum {\n        bail!(\n          \"Checksum mismatch for {}: expected {}, got {}\",\n          path,\n          entry.checksum,\n          file.hash\n        );\n      }\n    } else {\n      bail!(\"File {} not found in the tarball\", path);\n    }\n  }\n\n  for (specifier, expected) in &manifest.exports {\n    let actual = package.exports.get(specifier).ok_or_else(|| {\n      deno_core::anyhow::anyhow!(\n        \"Export {} not found in the package\",\n        specifier\n      )\n    })?;\n    if actual != expected {\n      bail!(\n        \"Export {} mismatch: expected {}, got {}\",\n        specifier,\n        expected,\n        actual\n      );\n    }\n  }\n\n  Ok(())\n}\n\nstatic SUPPORTED_LICENSE_FILE_NAMES: [&str; 12] = [","sourceCodeStart":1483,"sourceCodeEnd":1519,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/publish/mod.rs#L1483-L1519","documentation":"During publish-time tarball verification, Deno compares the package's declared exports map (from deno.json `exports`) against the exports recorded in the tarball's manifest; if a specifier present in the manifest has no entry in the package's exports map, this error names the orphaned export and aborts. It is an internal consistency check — the two views of the exports map should never diverge when the tarball was just built from that package.","triggerScenarios":"Files in the package changing on disk between graph building and tarball packing (concurrent edit during publish); an exports map modified mid-publish; a corrupted or truncated tarball being verified. In practice this fires inside Deno's own verification path, not from user config directly.","commonSituations":"Publishing while a formatter/watcher/build process rewrites deno.json or dist files; flaky CI where the checkout is mutated by a previous step; extremely rare manifest/pack race — most users never see it.","solutions":["Re-run `deno publish` from a clean, quiescent checkout (no concurrent file writes) — transient divergence disappears.","Ensure no step in CI mutates deno.json exports or source files while publish runs; run publish as its own job/step after builds finish.","If it reproduces deterministically, inspect the package's `exports` map in deno.json for duplicate/odd specifier keys and normalize it, then retry.","Report a deterministic reproducer to the deno repository — a mismatch here indicates a bug in packaging, not user error."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await runDeno(['publish']);\n} catch (e) {\n  if (String(e.message).includes('not found in the package')) {\n    // re-run from a clean checkout with no concurrent file writes\n    await runDeno(['publish']);\n  }\n}","preventionTips":["Publish from a clean, quiescent checkout (git clean -xfd) with no watchers or formatters running.","Keep deno.json exports maps stable during publish; do CI file mutations in earlier steps.","Treat deterministic reproductions of this internal verification error as a bug and report it upstream."],"tags":["publish","jsr","tarball","verification","exports-map"],"backgroundTag":"manifest-mismatch","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}