{"record":{"id":"e331870cce228cf1","repo":"denoland/deno","slug":"plugin-host-has-closed","errorCode":null,"errorMessage":"Plugin host has closed","messagePattern":"Plugin host has closed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/lint/plugins.rs","lineNumber":484,"sourceCode":"    let (tx, rx) = oneshot::channel();\n    self\n      .tx\n      .send(PluginHostRequest::LoadPlugins {\n        specifiers,\n        exclude_rules,\n        tx,\n      })\n      .await?;\n\n    if let Ok(val) = rx.await {\n      let PluginHostResponse::LoadPlugin(result) = val else {\n        unreachable!()\n      };\n      let infos = result?;\n      *self.plugin_info.lock() = infos;\n      return Ok(());\n    }\n    bail!(\"Plugin host has closed\")\n  }\n\n  pub async fn run_rules(\n    &self,\n    specifier: &Path,\n    serialized_ast: Vec<u8>,\n    source_text_info: SourceTextInfo,\n    utf16_map: Utf16Map,\n    maybe_token: Option<CancellationToken>,\n  ) -> Result<Vec<LintDiagnostic>, AnyError> {\n    let (tx, rx) = oneshot::channel();\n    self\n      .tx\n      .send(PluginHostRequest::Run {\n        serialized_ast,\n        file_path: specifier.to_path_buf(),\n        source_text_info,\n        utf16_map,","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/lint/plugins.rs#L466-L502","documentation":"When `deno lint` loads plugins, it sends a LoadPlugin request to a dedicated plugin-host worker over a oneshot channel. If the channel receive fails (rx.await is Err) — meaning the host worker terminated before replying — this bail fires. The plugin host died: crashed, exited, or was killed, so plugin metadata can never arrive.","triggerScenarios":"A lint plugin that panics or calls Deno.exit() during load; the plugin-host worker being killed (OOM, permissions sandbox terminating it); a plugin import path that hangs then dies. rx.await returns Err when the sender is dropped because the host is gone.","commonSituations":"Plugins written against an older plugin API after a Deno upgrade; plugin files with top-level errors; CI runners with tight memory limits killing the host worker.","solutions":["Run `deno lint` in the terminal and read the plugin host's stderr — the crash reason prints above this error","Test the plugin standalone (`deno run plugin.ts`) to find the load-time error","Update the plugin to match your Deno version's lint-plugin API, or pin the Deno version the plugin supports"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# smoke-load the plugin before linting the repo:\ndeno run --allow-read ./lint-plugin.ts && deno lint","typeGuard":null,"tryCatchPattern":"Catch 'Plugin host has closed' during plugin load: log that the plugin host crashed, run `deno run ./plugin.ts` to surface the actual load error, and fail the lint job with that underlying message rather than the generic one.","preventionTips":["Test plugins standalone (`deno run plugin.ts`) before registering them","Re-verify plugins on every Deno upgrade — the plugin API is version-sensitive","Watch lint stderr for host-worker panics; fix them instead of retrying blindly"],"tags":["lint","plugin","worker","crash","ipc"],"backgroundTag":"plugin-host-crashed","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}