diff --git a/packages/router/src/apply_redirects.ts b/packages/router/src/apply_redirects.ts index 22228b1290..8b6a2ec2f0 100644 --- a/packages/router/src/apply_redirects.ts +++ b/packages/router/src/apply_redirects.ts @@ -502,7 +502,8 @@ function mergeTrivialChildren(s: UrlSegmentGroup): UrlSegmentGroup { */ function squashSegmentGroup(segmentGroup: UrlSegmentGroup): UrlSegmentGroup { const newChildren = {} as any; - for (const [childOutlet, child] of Object.entries(segmentGroup.children)) { + for (const childOutlet of Object.keys(segmentGroup.children)) { + const child = segmentGroup.children[childOutlet]; const childCandidate = squashSegmentGroup(child); // don't add empty children if (childCandidate.segments.length > 0 || childCandidate.hasChildren()) {