denoland/deno · error · AnyError
Found problem
Error message
Found {} problem{} What it means
This is the terminal summary of `deno publish`'s 'slow types' check: the diagnostics collector counted N type-checking problems in the package's public API (typically exported functions/classes missing explicit return or parameter types), printed each one above, and now aborts the publish. JSR requires fully explicit types because it generates docs and .d.ts files without executing a type-checker on every consumer. Pass `--allow-slow-types` only if you accept the downsides listed in the message.
Solutions
- Read the diagnostics printed above the summary; add explicit types to each flagged public/exported symbol (return types and parameter types).
- Re-run `deno publish` (or `deno publish --dry-run`) until the check passes — dry-run runs the same diagnostics without uploading.
- If the types genuinely cannot be made explicit and you accept slower consumer type-checking, no docs generation, and no .d.ts for Node, publish with `--allow-slow-types`.
- Keep internals non-exported (remove `export`) so they are exempt from the public-API type requirements.
Example fix
// before
export function greet(name) {
return `hello ${name}`;
}
// after
export function greet(name: string): string {
return `hello ${name}`;
} Defensive patterns
Strategy: validation
Validate before calling
const cmd = new Deno.Command('deno', {
args: ['publish', '--dry-run'],
});
const { code, stderr } = await cmd.output();
const text = new TextDecoder().decode(stderr);
const slowTypes = /Found \d+ problem/.test(text);
if (code !== 0 && slowTypes) {
// fail early with the diagnostics; do not attempt the real publish
} Try / catch
try {
await runDeno(['publish']);
} catch (e) {
if (/Found \d+ problem/.test(String(e.message))) {
// parse the diagnostics above the summary and add explicit types,
// or re-run with --allow-slow-types after a conscious decision
}
} Prevention
- Run `deno publish --dry-run` in CI before the real publish step.
- Type all exported symbols explicitly (params and return types) as a lint habit.
- Keep the public API surface small; unexported internals are exempt from slow-types checks.
- Never reach for --allow-slow-types mechanically — it degrades consumer type-checking, docs, and .d.ts generation.
When it happens
Trigger: `export function greet(name) { ... }` (no return/param types); `export const config = { ... }` whose inferred type is not nameable; re-exporting a value whose type cannot be computed from syntax alone; publishing with these diagnostics and without `--allow-slow-types`.
Common situations: Porting a quick prototype to JSR; TS code that relies on inference everywhere and compiled fine under `deno run`; version upgrades that tightened the slow-types rules so a package that published before now fails.
Related errors
- 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@9ad36f7a2c (2026-08-20).
Data as JSON: /api/errors/cc5ecc566434c8bc.
Report an issue: GitHub.
Appendix: source
Thrown at cli/tools/publish/diagnostics.rs:68
}
}
if errors > 0 {
if has_slow_types_errors {
log::error!(
"This package contains errors for slow types. Fixing these errors will:\n"
);
log::error!(
" 1. Significantly improve your package users' type checking performance."
);
log::error!(" 2. Improve the automatic documentation generation.");
log::error!(" 3. Enable automatic .d.ts generation for Node.js.");
log::error!(
"\nDon't want to bother? You can choose to skip this step by"
);
log::error!("providing the --allow-slow-types flag.\n");
}
Err(anyhow!(
"Found {} problem{}",
errors,
if errors == 1 { "" } else { "s" }
))
} else {
Ok(())
}
}
pub fn has_error(&self) -> bool {
self
.diagnostics
.lock()
.iter()
.any(|d| matches!(d.level(), DiagnosticLevel::Error))
}
pub fn push(&self, diagnostic: PublishDiagnostic) {View on GitHub (pinned to 9ad36f7a2c)