DioxusLabs/dioxus · error · anyhow::Error
A file or directory with the given project name "{}" already
Error message
A file or directory with the given project name "{}" already exists. What it means
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.
Source
Thrown at packages/cli/src/cli/create.rs:241
Ok(())
}
fn remove_triple_newlines(string: &str) -> String {
let mut new_string = String::new();
for char in string.chars() {
if char == '\n' && new_string.ends_with("\n\n") {
continue;
}
new_string.push(char);
}
new_string
}
/// Check if the requested project can be created in the filesystem
pub(crate) async fn check_path(path: &std::path::PathBuf) -> Result<()> {
match fs::metadata(path) {
Ok(_metadata) => {
bail!(
"A file or directory with the given project name \"{}\" already exists.",
path.to_string_lossy()
)
}
Err(_err) => Ok(()),
}
}
/// Perform a health check against github itself before we attempt to download any templates hosted
/// on github.
pub(crate) async fn check_connectivity() -> Result<()> {
if crate::verbosity_or_default().offline {
return Ok(());
}
use crate::styles::{GLOW_STYLE, LINK_STYLE};
let client = reqwest::Client::new();
for x in 0..=5 {View on GitHub (pinned to 24f6a829df)
Solutions
- A file or directory with the project name already exists. Choose another name or remove the existing path.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/cli/src/cli/create.rs:241 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23).
Data as JSON: /api/errors/ebdf2946ad6d595c.
Report an issue: GitHub.