Parallel, intercepted catchall routes provided wrong params
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/Drewsapple/repro-intercept-catchall
To Reproduce
- Start the app (
next devornext build && next start) - navigate to
/reproduction - click the link to
/reproduction/double/double - refresh the page or otherwise load the same route so navigation is not intercepted
Current vs. Expected behavior
When the default export from (.)[...catchall]/page.tsx is loaded, the params object passed is are follows:
Navigating to /reproduction/single
{"catchall":["single"]}
Navigating to /reproduction/double/double
{"catchall":["doubledouble"]}
Instead of the route segments being concatenated as strings, they should be concatenated as array elements, i.e.
{"catchall":["double","double"]}
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Debian 6.11.6-1 (2024-11-04)
Available memory (MB): 15748
Available CPU cores: 8
Binaries:
Node: 20.11.1
npm: 10.9.0
Yarn: N/A
pnpm: 9.14.2
Relevant Packages:
next: 14.2.18 // An outdated version detected (latest is 15.0.3), upgrade is highly recommended!
eslint-config-next: N/A
react: 18.3.1
react-dom: 18.3.1
typescript: 5.6.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Parallel & Intercepting Routes
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
I tried this in v14.2.14 as well, to see if it was a regression introduced by #65063 in v14.2.15, but the behavior was the same.
In v15.0.3 (with awaited params), the catchall group doesn't intercept a navigation with multiple path segments at all. This modification is tracked in the v15.0.3 branch of the reproduction repo.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction repository and its (.)[...catchall]/page.tsx route, then run the documented navigation and refresh steps under the affected Next.js versions. Compare intercepted and directly loaded /reproduction/double/double params; done means both paths provide {"catchall":["double","double"]} while preserving the single-segment behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100