zed-industries/zed · error · anyhow::Error
Failed to parse notebook: {:?}
Error message
Failed to parse notebook: {:?} What it means
Error raised while loading a notebook file in the notebook UI: `nbformat::parse_notebook` failed to interpret the serialized JSON as a valid notebook format (V4, V3, or legacy). The debug-formatted parse error is embedded in the message. Loading is aborted before cells are constructed.
Source
Thrown at crates/repl/src/notebook/notebook_ui.rs:1967
let notebook = nbformat::parse_notebook(&file_content);
let notebook = match notebook {
Ok(nbformat::Notebook::V4(notebook)) => notebook,
Ok(nbformat::Notebook::Legacy(legacy_notebook)) => {
nbformat::upgrade_legacy_notebook(legacy_notebook)?
}
Ok(nbformat::Notebook::V3(v3_notebook)) => {
nbformat::upgrade_v3_notebook(v3_notebook)?
}
Err(e) => {
anyhow::bail!("Failed to parse notebook: {:?}", e);
}
};View on GitHub (pinned to f4178619ac)
Solutions
- Re-export or re-save the notebook from Jupyter to regenerate valid nbformat JSON.
- Validate the notebook JSON structure manually and fix malformed cells, metadata, or nbformat version fields.
- Open a different, known-good notebook to confirm the issue is specific to this file.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/repl/src/notebook/notebook_ui.rs:1967 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/8ecbe3f4f3a0e690.
Report an issue: GitHub.