{"record":{"id":"f7f465818e419409","repo":"zed-industries/zed","slug":"failed-to-create-component-preview","errorCode":null,"errorMessage":"Failed to create component preview","messagePattern":"Failed to create component preview","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/component_preview/src/component_preview.rs","lineNumber":840,"sourceCode":"\n        window.spawn(cx, async move |cx| {\n            let user_store = user_store.clone();\n            let language_registry = language_registry.clone();\n            let weak_workspace = workspace.clone();\n            let project = project.clone();\n            cx.update(move |window, cx| {\n                Ok(cx.new(|cx| {\n                    ComponentPreview::new(\n                        weak_workspace,\n                        project,\n                        language_registry,\n                        user_store,\n                        None,\n                        preview_page,\n                        window,\n                        cx,\n                    )\n                    .expect(\"Failed to create component preview\")\n                }))\n            })?\n        })\n    }\n\n    fn cleanup(\n        workspace_id: WorkspaceId,\n        alive_items: Vec<ItemId>,\n        _window: &mut Window,\n        cx: &mut App,\n    ) -> Task<anyhow::Result<()>> {\n        delete_unloaded_items(\n            alive_items,\n            workspace_id,\n            \"component_previews\",\n            &ComponentPreviewDb::global(cx),\n            cx,\n        )","sourceCodeStart":822,"sourceCodeEnd":858,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/component_preview/src/component_preview.rs#L822-L858","documentation":"Error in ComponentPreview::deserialize when reconstructing a serialized component preview workspace item: rebuilding the ComponentPreview entity inside the window failed (project, language registry, or user store unavailable, or the preview page could not be re-created), so the saved pane state cannot be restored.","triggerScenarios":"Thrown at crates/component_preview/src/component_preview.rs:840 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Discard the stale serialized item state and open a fresh component preview","Verify the project and language registry are initialized before deserialization","Re-save workspace state after upgrading if the serialized format changed"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}