denoland/deno · error

Export {} not found in the package

Error message

Export {} not found in the package

What it means

After uploading a package, `deno publish` downloads the version manifest the registry produced and verifies it against the locally prepared package (`verify_version_manifest`, publish/mod.rs:1159). This error fires when the registry manifest's `exports` map contains a specifier (e.g. `./mod`) that the local `PreparedPublishPackage.exports` does not have. The server's report of the package and what the client prepared disagree.

Source

Thrown at cli/tools/publish/mod.rs:1436

      .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 89f33cbef2)

Solutions

  1. Upgrade Deno to the latest release and publish again — this path depends on exact agreement between client and registry behavior
  2. Open the package page on jsr.io and compare the exports the uploaded version actually received against deno.json `exports`
  3. If the version was partially published, bump the version in deno.json and publish fresh
  4. If it reproduces on current Deno, capture the registry response with DENO_LOG=debug and open an issue
Defensive patterns

Strategy: retry

Validate before calling

# sanity-check that every deno.json export points at an existing file
deno eval 'const c = JSON.parse(Deno.readTextFileSync("deno.json"));
for (const [k, v] of Object.entries(c.exports ?? {})) {
  if (!Deno.statSync(v).isFile) { console.error(`export ${k} -> missing ${v}`); Deno.exit(1); }
}'

Prevention

When it happens

Trigger: `deno publish` reaches post-upload verification and the manifest returned by the registry lists an export entry the client never prepared — typically client/server version skew or an unexpected registry response, since the local exports map normally mirrors deno.json `exports` exactly.

Common situations: Publishing with an outdated Deno version against a newer registry API; a proxy or intermediary returning a manifest for a different or previous version of the package; retrying an interrupted publish against an already-uploaded version.

Related errors


AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16). Data as JSON: /api/errors/a7fc240fc02a4a67. Report an issue: GitHub.