{"record":{"id":"cc5ecc566434c8bc","repo":"denoland/deno","slug":"found-problem","errorCode":null,"errorMessage":"Found {} problem{}","messagePattern":"Found (.+?) problem(.+?)","errorType":"exception","errorClass":"AnyError","httpStatus":null,"severity":"error","filePath":"cli/tools/publish/diagnostics.rs","lineNumber":68,"sourceCode":"      }\n    }\n    if errors > 0 {\n      if has_slow_types_errors {\n        log::error!(\n          \"This package contains errors for slow types. Fixing these errors will:\\n\"\n        );\n        log::error!(\n          \"  1. Significantly improve your package users' type checking performance.\"\n        );\n        log::error!(\"  2. Improve the automatic documentation generation.\");\n        log::error!(\"  3. Enable automatic .d.ts generation for Node.js.\");\n        log::error!(\n          \"\\nDon't want to bother? You can choose to skip this step by\"\n        );\n        log::error!(\"providing the --allow-slow-types flag.\\n\");\n      }\n\n      Err(anyhow!(\n        \"Found {} problem{}\",\n        errors,\n        if errors == 1 { \"\" } else { \"s\" }\n      ))\n    } else {\n      Ok(())\n    }\n  }\n\n  pub fn has_error(&self) -> bool {\n    self\n      .diagnostics\n      .lock()\n      .iter()\n      .any(|d| matches!(d.level(), DiagnosticLevel::Error))\n  }\n\n  pub fn push(&self, diagnostic: PublishDiagnostic) {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/publish/diagnostics.rs#L50-L86","documentation":"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.","triggerScenarios":"`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`.","commonSituations":"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.","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."],"exampleFix":"// before\nexport function greet(name) {\n  return `hello ${name}`;\n}\n\n// after\nexport function greet(name: string): string {\n  return `hello ${name}`;\n}","handlingStrategy":"validation","validationCode":"const cmd = new Deno.Command('deno', {\n  args: ['publish', '--dry-run'],\n});\nconst { code, stderr } = await cmd.output();\nconst text = new TextDecoder().decode(stderr);\nconst slowTypes = /Found \\d+ problem/.test(text);\nif (code !== 0 && slowTypes) {\n  // fail early with the diagnostics; do not attempt the real publish\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runDeno(['publish']);\n} catch (e) {\n  if (/Found \\d+ problem/.test(String(e.message))) {\n    // parse the diagnostics above the summary and add explicit types,\n    // or re-run with --allow-slow-types after a conscious decision\n  }\n}","preventionTips":["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."],"tags":["publish","jsr","slow-types","typechecking","api-design"],"backgroundTag":"type-checking-diagnostics","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}