{"record":{"id":"1731ced5b1b9d818","repo":"biomejs/biome","slug":"to-have-a-valid-utf-8-path","errorCode":null,"errorMessage":"To have a valid UTF-8 path","messagePattern":"To have a valid UTF-8 path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/biome_lsp/src/session.rs","lineNumber":1034,"sourceCode":"\n    /// This function attempts to read the `biome.json` configuration file from\n    /// the root URI and update the workspace settings accordingly\n    #[tracing::instrument(level = \"debug\", skip(self))]\n    pub(crate) async fn load_workspace_settings(self: &Arc<Self>, reload: bool) {\n        if let Some(config_path) = self.resolve_configuration_path(None) {\n            info!(\"Detected configuration path in the workspace settings.\");\n            let config_file_path = config_path.to_path_buf();\n            let status = self\n                .load_biome_configuration_file(config_path, reload)\n                .await;\n            debug!(\"Configuration status: {:?}\", status);\n            self.record_configuration_status(config_file_path.as_deref(), status);\n        } else if let Some(folders) = self.get_workspace_folders() {\n            info!(\"Detected workspace folder.\");\n            for folder in folders {\n                info!(\"Attempt to load the configuration file in {:?}\", folder.uri);\n                let base_path = folder.uri.to_file_path().map(|p| {\n                    Utf8PathBuf::from_path_buf(p.to_path_buf()).expect(\"To have a valid UTF-8 path\")\n                });\n                match base_path {\n                    Some(base_path) => {\n                        let status = self\n                            .load_biome_configuration_file(\n                                ConfigurationPathHint::FromWorkspace(base_path.clone()),\n                                reload,\n                            )\n                            .await;\n                        debug!(\"Configuration status: {:?}\", status);\n                        self.record_configuration_status(Some(&base_path), status);\n                    }\n                    None => {\n                        error!(\n                            \"The Workspace root URI {:?} could not be parsed as a filesystem path\",\n                            folder.uri\n                        );\n                    }","sourceCodeStart":1016,"sourceCodeEnd":1052,"githubUrl":"https://github.com/biomejs/biome/blob/0fca643d22845c28e0e0b7375013155e3f80717f/crates/biome_lsp/src/session.rs#L1016-L1052","documentation":"Error \"To have a valid UTF-8 path\" thrown in biomejs/biome.","triggerScenarios":"Thrown at crates/biome_lsp/src/session.rs:1033 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the URI received by the LSP server maps to a valid UTF-8 file path.","Reject or normalize non-UTF-8 document URIs at the session boundary."],"exampleFix":"let path = url_to_path(&uri).ok_or_else(|| /* invalid URI error */)?;","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0fca643d22845c28e0e0b7375013155e3f80717f","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}