diff --git a/crates/oxc_linter/src/rules/import/no_cycle.rs b/crates/oxc_linter/src/rules/import/no_cycle.rs index 268bb9e4f..fddde1e80 100644 --- a/crates/oxc_linter/src/rules/import/no_cycle.rs +++ b/crates/oxc_linter/src/rules/import/no_cycle.rs @@ -113,8 +113,11 @@ impl Rule for NoCycle { let help = stack .iter() .map(|(specifier, path)| { - let path = - path.strip_prefix(&cwd).unwrap().to_string_lossy().replace('\\', "/"); + let path = path + .strip_prefix(&cwd) + .unwrap_or(path) + .to_string_lossy() + .replace('\\', "/"); format!("-> {specifier} - {path}") }) .collect::>()