denoland/deno · error
You did not specify an entrypoint in {}. Add `exports` mappi
Error message
You did not specify an entrypoint in {}. Add `exports` mapping in the configuration file, eg:
{} What it means
A JSR package must expose an entrypoint through the `exports` field of its config file. This error is raised (by `error_missing_exports_field`) for a config that has a name but no exports mapping, and the message embeds a ready-to-paste deno.json snippet — using a suggested entrypoint (e.g. ./mod.ts or ./index.ts) when one is detected in the package.
Source
Thrown at cli/tools/publish/mod.rs:1596
for entrypoint in SUGGESTED_ENTRYPOINTS {
if deno_json.dir_path().join(entrypoint).exists() {
suggested_entrypoint = Some(entrypoint);
break;
}
}
let exports_content = format!(
r#"{{
"name": "{}",
"version": "{}",
"exports": "{}"
}}"#,
deno_json.json.name.as_deref().unwrap_or("@scope/name"),
deno_json.json.name.as_deref().unwrap_or("0.0.0"),
suggested_entrypoint.unwrap_or("<path_to_entrypoint>")
);
bail!(
"You did not specify an entrypoint in {}. Add `exports` mapping in the configuration file, eg:\n{}",
deno_json.specifier,
exports_content
);
}
#[allow(clippy::print_stderr, reason = "actually want to output")]
fn ring_bell() {
// ASCII code for the bell character.
eprint!("\x07");
}
#[cfg(test)]
mod tests {
use std::collections::HashMap;
use deno_ast::ModuleSpecifier;
View on GitHub (pinned to f7822238ca)
Solutions
- Add an `exports` mapping to deno.json, e.g. `"exports": "./mod.ts"`, or a subpath map for multi-entry packages.
- Point it at the file that should be the public entrypoint — the snippet's suggested path is usually correct.
- If this package is not meant for JSR, mark it `"publish": false` instead of adding exports.
Example fix
// deno.json (before)
{
"name": "@scope/pkg",
"version": "1.0.0"
}
// deno.json (after)
{
"name": "@scope/pkg",
"version": "1.0.0",
"exports": "./mod.ts"
} Defensive patterns
Strategy: validation
Validate before calling
#!/usr/bin/env bash
node -e '
const c = JSON.parse(require("fs").readFileSync("deno.json", "utf8"));
if (!c.exports) { console.error("deno.json needs an exports entrypoint, e.g. \"exports\": \"./mod.ts\""); process.exit(1); }' Prevention
- Every JSR package config needs `name`, `version`, and `exports` — check all three in a pre-publish script.
- Point exports at the real public entrypoint (commonly ./mod.ts) and cover extra subpaths with a map.
- Mark non-published configs with `"publish": false` so they fail with a clearer error instead.
When it happens
Trigger: `deno publish` with a deno.json/jsr.json that defines `name` (and no `"publish": false`) but no `exports` field, so the package has no public entrypoint to publish.
Common situations: New packages scaffolded from a bare deno.json; converting an internal library to JSR; accidentally deleting or renaming the exports key.
Related errors
- Couldn't find a deno.json, deno.jsonc, jsr.json or jsr.jsonc
- No packages to publish
- Export {} mismatch: expected {}, got {}
- {} is missing 'version' field
- Missing 'exports' field in '{}'. Add an exports field like:
AI-assisted analysis of denoland/deno@f7822238ca (2026-08-20).
Data as JSON: /api/errors/14645047fe09550e.
Report an issue: GitHub.