{"record":{"id":"ebdf2946ad6d595c","repo":"DioxusLabs/dioxus","slug":"a-file-or-directory-with-the-given-project-name","errorCode":null,"errorMessage":"A file or directory with the given project name \"{}\" already exists.","messagePattern":"A file or directory with the given project name \"(.+?)\" already exists\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/cli/create.rs","lineNumber":241,"sourceCode":"    Ok(())\n}\n\nfn remove_triple_newlines(string: &str) -> String {\n    let mut new_string = String::new();\n    for char in string.chars() {\n        if char == '\\n' && new_string.ends_with(\"\\n\\n\") {\n            continue;\n        }\n        new_string.push(char);\n    }\n    new_string\n}\n\n/// Check if the requested project can be created in the filesystem\npub(crate) async fn check_path(path: &std::path::PathBuf) -> Result<()> {\n    match fs::metadata(path) {\n        Ok(_metadata) => {\n            bail!(\n                \"A file or directory with the given project name \\\"{}\\\" already exists.\",\n                path.to_string_lossy()\n            )\n        }\n        Err(_err) => Ok(()),\n    }\n}\n\n/// Perform a health check against github itself before we attempt to download any templates hosted\n/// on github.\npub(crate) async fn check_connectivity() -> Result<()> {\n    if crate::verbosity_or_default().offline {\n        return Ok(());\n    }\n\n    use crate::styles::{GLOW_STYLE, LINK_STYLE};\n    let client = reqwest::Client::new();\n    for x in 0..=5 {","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/cli/create.rs#L223-L259","documentation":"Pre-creation guard in check_path (called from create): a filesystem metadata probe on the target project path succeeded, meaning a file or directory with the requested project name already exists where `dx create` wants to scaffold a new project. The input at fault is the chosen project name/path, which would collide with existing content.","triggerScenarios":"Thrown at packages/cli/src/cli/create.rs:241 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["A file or directory with the project name already exists. Choose another name or remove the existing path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}