diff --git a/packages/next-swc/crates/next-core/src/app_source.rs b/packages/next-swc/crates/next-core/src/app_source.rs index 16d9f3fafcdb5..47b9e7b6f6aaf 100644 --- a/packages/next-swc/crates/next-core/src/app_source.rs +++ b/packages/next-swc/crates/next-core/src/app_source.rs @@ -102,9 +102,9 @@ use crate::{ fn pathname_to_segments(pathname: &str) -> (Vec, Option) { let mut segments = Vec::new(); for segment in pathname.split('/') { - if segment.is_empty() { - // ignore - } else if segment.starts_with('(') && segment.ends_with(')') || segment.starts_with('@') { + if segment.is_empty() + || (segment.starts_with('(') && segment.ends_with(')') || segment.starts_with('@')) + { // ignore } else if segment.starts_with("[[...") && segment.ends_with("]]") || segment.starts_with("[...") && segment.ends_with(']') @@ -119,7 +119,7 @@ fn pathname_to_segments(pathname: &str) -> (Vec, Option