denoland/deno · error · AnyError
Export not found in the package
Error message
Export {} not found in the package What it means
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.
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.
Defensive patterns
Strategy: retry
Try / catch
try {
await runDeno(['publish']);
} catch (e) {
if (String(e.message).includes('not found in the package')) {
// re-run from a clean checkout with no concurrent file writes
await runDeno(['publish']);
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- File not found in the tarball
- Cannot represent compiler option
- Cannot use --set-version when publishing a workspace…
- Checksum mismatch for
- Couldn't find a deno.json, deno.jsonc, jsr.json or…
AI-assisted analysis of denoland/deno@f7822238ca (2026-08-20).
Data as JSON: /api/errors/a7fc240fc02a4a67.
Report an issue: GitHub.
Appendix: source
Thrown at cli/tools/publish/mod.rs:1501
.find(|f| f.path_str == path.as_str());
if let Some(file) = file {
if file.hash != entry.checksum {
bail!(
"Checksum mismatch for {}: expected {}, got {}",
path,
entry.checksum,
file.hash
);
}
} else {
bail!("File {} not found in the tarball", path);
}
}
for (specifier, expected) in &manifest.exports {
let actual = package.exports.get(specifier).ok_or_else(|| {
deno_core::anyhow::anyhow!(
"Export {} not found in the package",
specifier
)
})?;
if actual != expected {
bail!(
"Export {} mismatch: expected {}, got {}",
specifier,
expected,
actual
);
}
}
Ok(())
}
static SUPPORTED_LICENSE_FILE_NAMES: [&str; 12] = [View on GitHub (pinned to f7822238ca)