{"record":{"id":"50631d47eaf37916","repo":"denoland/deno","slug":"repl-thread-panicked","errorCode":null,"errorMessage":"REPL thread panicked","messagePattern":"REPL thread panicked","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cli/tools/jupyter/mod.rs","lineNumber":260,"sourceCode":"    op_state.put(KernelIsolateHandle {\n      handle: isolate_handle,\n    });\n    op_state.put(KernelConnectionInfo { json: conn_file });\n  }\n\n  // Bootstrap the JS ZMQ kernel then run the event loop.\n  kernel_worker.execute_script_static(\n    located_script_name!(),\n    \"Deno[Deno.internal].startJupyterKernel();\",\n  )?;\n  let mut kernel_main = kernel_worker.into_main_worker();\n  kernel_main.run_event_loop(false).await?;\n\n  // Wait for the REPL thread to finish.\n  match repl_thread.join() {\n    Ok(Ok(())) => {}\n    Ok(Err(e)) => bail!(\"REPL thread error: {}\", e),\n    Err(_) => bail!(\"REPL thread panicked\"),\n  }\n\n  Ok(())\n}\n\n// ------------------------------------------------------------------\n// REPL session wrapper running on the background thread\n// ------------------------------------------------------------------\n\nstruct JupyterReplSession {\n  repl_session: repl::ReplSession,\n  rx: mpsc::UnboundedReceiver<JupyterReplRequest>,\n}\n\nimpl JupyterReplSession {\n  async fn start(&mut self) {\n    let mut poll_worker = true;\n    loop {","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/jupyter/mod.rs#L242-L278","documentation":"Same join point as the REPL-thread error, but the thread panicked instead of returning Err: join() gives Err (a Box<dyn Any> payload). A panic in the REPL thread is always a Deno bug (or a plugin/native dependency corrupting state) — the message cannot tell you the panic text because the payload is opaque.","triggerScenarios":"Any panic! / unwrap on None / index-out-of-bounds inside the REPL session code running on the spawned thread; the main kernel worker finished its event loop, then the join failed.","commonSituations":"Nightly or freshly released Deno builds with kernel regressions; notebooks exercising unusual expression types that hit unwraps in the REPL evaluator.","solutions":["Restart the kernel and re-run the notebook — note which cell ran right before the crash","Update Deno (panics in this path get patched quickly); if on a nightly, try the last stable","File an issue at github.com/denoland/deno/issues with the notebook cell and RUST_BACKTRACE=1 deno jupyter --kernel output"],"exampleFix":"# capture a backtrace for the bug report:\nRUST_BACKTRACE=1 deno jupyter --kernel --conn /path/to/kernel.json","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"On 'REPL thread panicked', restart the kernel once; if the same cell panics again, stop retrying, capture RUST_BACKTRACE=1 output, and report upstream — a panicked thread is a bug, not a transient condition.","preventionTips":["Pin stable Deno releases for notebook work","Note which cell executes immediately before the panic to build a minimal repro","Run `RUST_BACKTRACE=1 deno jupyter --kernel ...` when reproducing to attach a backtrace"],"tags":["jupyter","repl","thread","panic","bug"],"backgroundTag":"background-thread-panic","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"}