{"record":{"id":"cc5ecc566434c8bc","repo":"denoland/deno","slug":"found-problem","errorCode":null,"errorMessage":"Found {} problem{}","messagePattern":"Found (.+?) problem(.+?)","errorType":"exception","errorClass":null,"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/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/publish/diagnostics.rs#L50-L86","documentation":"`deno publish` type-checks packages and refuses 'slow types' — public APIs lacking explicit types — collecting every diagnostic before failing. This is the summary error: N diagnostics were emitted (each printed above with file and position), and without --allow-slow-types the publish aborts.","triggerScenarios":"`deno publish` (including --dry-run) where exported symbols rely on inference — missing parameter/return types on exported functions, implicit any in public class members — so the collector accumulated one or more errors.","commonSituations":"Porting untyped JS to JSR; exported helpers relying on inference; library surfaces where .d.ts generation and consumer type-checking speed depend on explicit types.","solutions":["Fix the listed diagnostics: add explicit types at each reported file/position (start at the first error, later ones often cascade)","As a conscious stopgap, publish with --allow-slow-types (hurts consumer type-checking, docs, and .d.ts generation)","Run `deno publish --dry-run` locally and in CI so problems surface before a release"],"exampleFix":"// before\nexport function add(a, b) {\n  return a + b;\n}\n// after\nexport function add(a: number, b: number): number {\n  return a + b;\n}","handlingStrategy":"validation","validationCode":"# catch slow types in CI before a release attempt\ndeno publish --dry-run","typeGuard":null,"tryCatchPattern":"# release script: fail with guidance when the summary error appears\ndeno publish --dry-run 2>&1 | tee /tmp/publish.log\nif grep -q \"Found .* problem\" /tmp/publish.log; then\n  echo 'fix the listed diagnostics or pass --allow-slow-types deliberately' >&2\n  exit 1\nfi","preventionTips":["Run deno publish --dry-run on every PR","Write explicit types on anything exported from day one","Treat --allow-slow-types as a documented, deliberate decision — never a default"],"tags":["publish","slow-types","typescript","diagnostics"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}