denoland/deno · critical

REPL thread panicked

Error message

REPL thread panicked

What it means

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.

Source

Thrown at cli/tools/jupyter/mod.rs:260

    op_state.put(KernelIsolateHandle {
      handle: isolate_handle,
    });
    op_state.put(KernelConnectionInfo { json: conn_file });
  }

  // Bootstrap the JS ZMQ kernel then run the event loop.
  kernel_worker.execute_script_static(
    located_script_name!(),
    "Deno[Deno.internal].startJupyterKernel();",
  )?;
  let mut kernel_main = kernel_worker.into_main_worker();
  kernel_main.run_event_loop(false).await?;

  // Wait for the REPL thread to finish.
  match repl_thread.join() {
    Ok(Ok(())) => {}
    Ok(Err(e)) => bail!("REPL thread error: {}", e),
    Err(_) => bail!("REPL thread panicked"),
  }

  Ok(())
}

// ------------------------------------------------------------------
// REPL session wrapper running on the background thread
// ------------------------------------------------------------------

struct JupyterReplSession {
  repl_session: repl::ReplSession,
  rx: mpsc::UnboundedReceiver<JupyterReplRequest>,
}

impl JupyterReplSession {
  async fn start(&mut self) {
    let mut poll_worker = true;
    loop {

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Restart the kernel and re-run the notebook — note which cell ran right before the crash
  2. Update Deno (panics in this path get patched quickly); if on a nightly, try the last stable
  3. File an issue at github.com/denoland/deno/issues with the notebook cell and RUST_BACKTRACE=1 deno jupyter --kernel output

Example fix

# capture a backtrace for the bug report:
RUST_BACKTRACE=1 deno jupyter --kernel --conn /path/to/kernel.json
Defensive patterns

Strategy: retry

Try / catch

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.

Prevention

When it happens

Trigger: 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.

Common situations: Nightly or freshly released Deno builds with kernel regressions; notebooks exercising unusual expression types that hit unwraps in the REPL evaluator.

Related errors


AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20). Data as JSON: /api/errors/50631d47eaf37916. Report an issue: GitHub.