{"record":{"id":"8d02fbf2319210de","repo":"zed-industries/zed","slug":"invalid-utf-8","errorCode":null,"errorMessage":"Invalid UTF-8","messagePattern":"Invalid UTF-8","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/yarn.rs","lineNumber":83,"sourceCode":"    }\n\n    pub(crate) fn process_path(\n        &mut self,\n        path: &Path,\n        protocol: &str,\n        cx: &Context<Self>,\n    ) -> Task<Option<(Arc<Path>, Arc<RelPath>)>> {\n        let mut is_zip = protocol.eq(\"zip\");\n\n        let path: &Path = if let Some(non_zip_part) = path\n            .as_os_str()\n            .as_encoded_bytes()\n            .strip_prefix(\"/zip:\".as_bytes())\n        {\n            // typescript-language-server prepends the paths with zip:, which is messy.\n            is_zip = true;\n            Path::new(OsStr::new(\n                std::str::from_utf8(non_zip_part).expect(\"Invalid UTF-8\"),\n            ))\n        } else {\n            path\n        };\n\n        let as_virtual = resolve_virtual(path);\n        let Some(path) = as_virtual.or_else(|| is_zip.then(|| Arc::from(path))) else {\n            return Task::ready(None);\n        };\n        if let Some(zip_file) = zip_path(&path) {\n            let zip_file: Arc<Path> = Arc::from(zip_file);\n            cx.spawn(async move |this, cx| {\n                let dir = this\n                    .read_with(cx, |this, _| {\n                        this.temp_dirs\n                            .get(&zip_file)\n                            .map(|temp| temp.path().to_owned())\n                    })","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/project/src/yarn.rs#L65-L101","documentation":"process_path panics converting a zip-prefixed LSP path back to a path because the remaining bytes after the '/zip:' prefix are not valid UTF-8; the language server sent a path that cannot be represented as a Rust string path.","triggerScenarios":"Thrown at crates/project/src/yarn.rs:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use PathBuf::from(OsString) via OsStr::from_encoded_bytes_unchecked on supported platforms instead of requiring UTF-8","Return None for non-UTF-8 paths so the buffer is skipped","Log the raw bytes to diagnose the offending language server output"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}