vercel / vercel/next.js

Parallel, intercepted catchall routes provided wrong params

Open
#73,104 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Parallel & Intercepting Routes
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
  1. Start the app (next dev or next build && next start)
  2. navigate to /reproduction
  3. click the link to /reproduction/double/double
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.