rsnext/test/e2e/app-dir/parallel-routes-and-interception/app
Aki Matsumoto 4fe968bb71
Fix: expected "catch all routes" are not matched in “parallel routes" (#58368)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?



-->
This PR fixes a bug where the expected catch-all route would not match
if there were multiple "catch-all routes" under the "parallel route”.

The page on the non-parallel routes path matches the catch all routes.
that exist on the more detailed path.
However, under parallel routes, it matches the most parent page of all
the pages with catch all routes.

For example, if there are files like below:
```
app/@sidebar/[...catchall]/page.tsx
app/@sidebar/dashboard/[...catchall]/page.tsx
```
When accessing `/foo`, it should match
`app/@sidebar/[...catchall]/page.tsx`, and this is working correctly.
However, when accessing `/dashboard/foo`, it should match
`app/@sidebar/dashboard/[...catchall]/page.tsx`, but
`app/@sidebar/[...catchall]/page.tsx` is being matched instead.

## Repository to reproduce
https://github.com/nonoakij/fix-parallel-routes-with-catch-all

## Related PR
https://github.com/vercel/next.js/pull/58215

---------

Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
2023-11-13 23:26:45 +01:00
..
(group) fix(turbopack): make layout in group not cause a 404 (#57471) 2023-10-26 05:16:28 +00:00
@slot Fix client reference manifest for interception routes (#52961) 2023-07-20 20:06:44 +00:00
[lang] interception routes: fix rewrites order (#49615) 2023-05-10 21:07:34 -07:00
intercepting-routes/feed interception routes: add new sibling matcher marker + validation (#48276) 2023-04-12 11:50:01 +02:00
intercepting-routes-dynamic/photos bugfix: route interception with dynamic paths (#51526) 2023-06-22 09:43:24 +00:00
intercepting-routes-dynamic-catchall/photos fix: interception rewrites should support catch-all segments (#51787) 2023-06-25 14:02:10 -07:00
intercepting-siblings interception routes: fix interception for dynamic routes (#58198) 2023-11-08 18:57:57 +00:00
nested parallel routes: fix layout not re-rendering (#48066) 2023-04-07 15:23:08 +02:00
nested-link interception routes: add new sibling matcher marker + validation (#48276) 2023-04-12 11:50:01 +02:00
parallel fix parallel route tests & improve error for conflicting pages (#53752) 2023-08-08 22:56:39 +00:00
parallel-catchall parallel routes: fix catch all route support (#58215) 2023-11-09 10:11:06 +00:00
parallel-dynamic/[slug] app-router: add support for parallel routes in useParams (#49595) 2023-05-11 10:32:41 +02:00
parallel-layout router: support layout/special files as direct children of parallel routes (#51604) 2023-06-21 11:16:21 +00:00
parallel-nested fix: prevent infinite dev refresh on nested parallel routes (#52362) 2023-07-07 07:41:21 +00:00
parallel-nested-catchall Fix: expected "catch all routes" are not matched in “parallel routes" (#58368) 2023-11-13 23:26:45 +01:00
parallel-no-page/foo fix: infinite dev reloads when parallel route is treated a page entry (#52061) 2023-07-04 12:37:00 +02:00
parallel-non-intercepting parallel routes: fix layout not re-rendering (#48066) 2023-04-07 15:23:08 +02:00
parallel-prefetch-false parallel routes: fix incorrect optimistic tree when there are multiple parallel routes (#48449) 2023-04-17 10:12:46 +02:00
parallel-scroll Fix scroll bailout logic when targeting fixed/sticky elements (#53873) 2023-08-15 13:31:39 +00:00
parallel-side-bar app-router: add batching support for RSC router payloads (#48253) 2023-04-12 09:53:13 +02:00
parallel-tab-bar parallel routes: implement default route + fix bugs on navigation (#47436) 2023-03-24 18:01:41 +01:00
layout.tsx parallel routes: fix layout not re-rendering (#48066) 2023-04-07 15:23:08 +02:00
page.tsx parallel routes: fix layout not re-rendering (#48066) 2023-04-07 15:23:08 +02:00