{"record":{"id":"dc6a6a87dc18f8b3","repo":"denoland/deno","slug":"failed-ensuring-public-api-type-output-is-valid","errorCode":null,"errorMessage":"Failed ensuring public API type output is valid.\n\n{:#}\n\nYou may have discovered a bug in Deno. Please open an issue at: https://github.com/denoland/deno/issues/","messagePattern":"Failed ensuring public API type output is valid\\.\n\n(.+?)\n\nYou may have discovered a bug in Deno\\. Please open an issue at: https://github\\.com/denoland/deno/issues/","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/publish/mod.rs","lineNumber":497,"sourceCode":"        // fast check passed, type check the output as a temporary measure\n        // until we know that it's reliable and stable\n        let mut diagnostics_by_folder = self.type_checker.check_diagnostics(\n          graph,\n          CheckOptions {\n            build_fast_check_graph: false, // already built\n            lib: self.cli_options.ts_type_lib_window(),\n            reload: self.cli_options.reload_flag(),\n            type_check_mode: self.cli_options.type_check_mode(),\n          },\n        )?;\n        // ignore unused (type) parameter diagnostics that may occur due to fast\n        // check not having function body implementations\n        for result in diagnostics_by_folder.by_ref() {\n          let check_diagnostics = result?;\n          let check_diagnostics =\n            check_diagnostics.filter(|d| d.include_when_remote());\n          if check_diagnostics.has_diagnostic() {\n            bail!(\n              concat!(\n                \"Failed ensuring public API type output is valid.\\n\\n\",\n                \"{:#}\\n\\n\",\n                \"You may have discovered a bug in Deno. Please open an issue at: \",\n                \"https://github.com/denoland/deno/issues/\"\n              ),\n              check_diagnostics\n            );\n          }\n        }\n        Ok(diagnostics_by_folder.into_graph())\n      }\n    }\n  }\n\n  async fn prepare_publish(\n    &self,\n    package: &JsrPackageConfig,","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/publish/mod.rs#L479-L515","documentation":"As a final quality gate, publish type-checks the public API type output that fast-check generates for your package (unused-parameter diagnostics excluded, because stripped bodies drop them). If checking the generated output produces diagnostics, the `.d.ts`-equivalent Deno would upload is itself invalid — which the message interprets as a probable Deno bug and asks you to report.","triggerScenarios":"The post-fast-check `TypeChecker` run yields diagnostics with `include_when_remote()` — e.g. exported constructs (complex overloads, declaration merging, inference-heavy generics) that Deno's public-API stripping renders invalid. `--allow-slow-types` does not bypass this check.","commonSituations":"Publishing packages with advanced TypeScript in exported entrypoints right after a Deno upgrade changed fast-check behavior; regressions introduced by a new Deno version.","solutions":["Upgrade Deno (`deno upgrade`) or pin back to the previous version — fast-check regressions are typically fixed in a patch release.","Adjust the exported constructs named in the attached diagnostics until the generated output type-checks.","If it persists, open an issue at https://github.com/denoland/deno/issues including the diagnostics and a minimal reproduction."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"#!/usr/bin/env bash\nout=\"$(deno publish --dry-run 2>&1)\" || {\n  if printf '%s' \"$out\" | grep -q 'You may have discovered a bug in Deno'; then\n    echo \"Deno fast-check bug suspected — pin the previous Deno version and report upstream\" >&2\n    exit 75  # dedicated code so pipelines can route it to an issue tracker\n  fi\n  printf '%s\\n' \"$out\" >&2\n  exit 1\n}","preventionTips":["Pin the Deno version in CI (`denoland/setup-deno` with a fixed version) so a new fast-check regression cannot break releases unattended.","Keep exported entrypoints' TypeScript simple; re-test publishes with `--dry-run` when adopting complex exported types.","Capture full diagnostics in CI logs — they are the required content of the upstream issue."],"tags":["publish","fast-check","type-check","diagnostics","upstream-bug"],"backgroundTag":"type-check-failed","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}