Skip to content

Commit

Permalink
fix nested parallel routes
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Neutkens <timneutkens@users.noreply.github.com>
  • Loading branch information
feedthejim and timneutkens committed Mar 20, 2023
1 parent 6617c01 commit bb74e99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/next/src/build/webpack/loaders/next-app-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ async function createTreeCodeFromPath(
continue
}

const parallelSegmentPath = segmentPath + '/' + parallelSegment
const { treeCode: subtreeCode } = await createSubtreePropsFromSegmentPath(
[
...segments,
Expand All @@ -195,6 +194,12 @@ async function createTreeCodeFromPath(
]
)

const parallelSegmentPath =
segmentPath +
'/' +
(parallelKey === 'children' ? '' : `@${parallelKey}/`) +
(Array.isArray(parallelSegment) ? parallelSegment[0] : parallelSegment)

// `page` is not included here as it's added above.
const filePaths = await Promise.all(
Object.values(FILE_TYPES).map(async (file) => {
Expand Down

0 comments on commit bb74e99

Please sign in to comment.