next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Optional catch-all route has highest priority when it should be last priority

Open jcontonio opened this issue 5 months ago • 1 comments

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/gifted-wescoff-nd4vf4

To Reproduce

  1. Start the application
  2. Visit the / route, or a /blah/blah route and see the [[...slug]]/page.tsx render
  3. Visit /resources/page/2 and see that [[...slug]]/page.tsx renders, not resources/page/[number].tsx

This used to work with the Pages router under Next 12.

Current vs. Expected behavior

Current behavior is catch-all routes have the highest priority Expected behavior is catch-all routes should have the lowest priority

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000
Binaries:
  Node: 18.18.0
  npm: 10.2.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.1.0
  eslint-config-next: 14.1.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 4.6.2
Next.js Config:
  output: N/A

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

App Router

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

next dev (local)

Additional context

No response

jcontonio avatar Feb 16 '24 23:02 jcontonio

(Updated the link, copied the wrong one)

jcontonio avatar Feb 17 '24 00:02 jcontonio

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

github-actions[bot] avatar Mar 06 '24 00:03 github-actions[bot]