zellij-org/zellij · error · anyhow::Error
Failed to parse layout
Error message
Failed to parse layout: {:?} What it means
Error "Failed to parse layout: {:?}" thrown in zellij-org/zellij.
Solutions
- Check the attached error for the underlying serialization failure and fix the offending data.
- Ensure plugin/wasm artifacts and zellij versions are compatible.
When it happens
Trigger: Occurs at zellij-server/src/plugins/zellij_exports.rs:2729 when the operation fails: "Failed to parse layout: {:?}". Currently there is no defensive handling preventing or contextualizing this failure before it surfaces.
Common situations: Typically version skew, corrupted data, or an unexpected payload shape.
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 zellij-org/zellij@5cb5df5cce (2026-08-19).
Data as JSON: /api/errors/4be406a31d8abc7c.
Report an issue: GitHub.
Appendix: source
Thrown at zellij-server/src/plugins/zellij_exports.rs:2729
.with_context(err_context)?;
Ok(())
}
fn switch_to_mode(env: &PluginEnv, input_mode: InputMode) {
let action = Action::SwitchToMode { input_mode };
let error_msg = || format!("failed to switch to mode in plugin {}", env.name());
apply_action!(action, error_msg, env);
}
fn new_tabs_with_layout(env: &PluginEnv, raw_layout: &str) -> Result<()> {
// TODO: cwd
let layout = Layout::from_str(
&raw_layout,
format!("Layout from plugin: {}", env.name()),
None,
None,
)
.map_err(|e| anyhow!("Failed to parse layout: {:?}", e))?;
apply_layout(env, layout);
Ok(())
}
fn new_tabs_with_layout_info(env: &PluginEnv, layout_info: LayoutInfo) -> Result<()> {
// TODO: cwd
let layout = Layout::from_layout_info(&env.layout_dir, layout_info)
.map_err(|e| anyhow!("Failed to parse layout: {:?}", e))?;
apply_layout(env, layout);
Ok(())
}
fn apply_layout(env: &PluginEnv, layout: Layout) {
let mut tabs_to_open = vec![];
let tabs = layout.tabs();
let cwd = None; // TODO: add this to the plugin API
if tabs.is_empty() {
let swap_tiled_layouts = Some(layout.swap_tiled_layouts.clone());View on GitHub (pinned to 5cb5df5cce)