Skip to content

parallel routes: catch all nested under dynamic segment matches to the root #58272

@wlechowicz

Description

@wlechowicz

Link to the code that reproduces this issue

https://github.com/wlechowicz/next14-catchall-repro

To Reproduce

Caused by #58215, see #58215 (comment)

  1. Start the application with npm run dev
  2. Observe the error:
 ○ Compiling / ...
 ⨯ app\page.tsx
You cannot have two parallel pages that resolve to the same path. Please check /page and /[lang]/@modal/[...catchAll]/page. Refer to the route group docs for more information: https://nextjs.org/docs/app/building-your-application/routing/route-groups
  1. If the @modal, foo and bar are moved up to the app root (outside of [lang]), no such error appears and the catchAll closes the "modal" as expected when any /bar/* non-intercepted Link is clicked.

Current vs. Expected behavior

Previous behavior (prior to #58215) was that that [...catchAll] was not matching non-intercepted routes at all. See #50284
Current behavior with this change is that error quoted above is thrown at compile time.
Expected behavior is that catch-all matches to the correct parallel route, not root.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:        
  Platform: win32        
  Arch: x64
  Version: Windows 10 Pro
Binaries:
  Node: 20.9.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.0.2-canary.27
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

App Router, Routing (next/router, next/navigation, next/link)

Additional context

No response

NEXT-1808

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.bugIssue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions