Catch all route within dynamic segment breaks dynamic 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://codesandbox.io/p/devbox/optimistic-brahmagupta-qcqflx
To Reproduce
- Start dev server
- Change locale to be anything but en
- Page is being rendered / no 404 even though there is dynamicParams = false on the locale's segment level
Current vs. Expected behavior
Following the steps from the previous section, I expected /de to render a 404, as dynamicParams is false and de ist not listed within the segment's static params. Somehow the nested catch all route breaks this behaviour and makes it fall back to a dynamic behaviour, trying to render the given locale, running into errors because the locale does not exist.
Provide environment information
Binaries:
Node: 20.9.0
npm: 9.8.1
Yarn: 1.22.19
pnpm: 8.10.2
Relevant Packages:
next: 15.0.0-canary.140 // Latest available version is detected (15.0.0-canary.140).
eslint-config-next: N/A
react: 19.0.0-rc-7771d3a7-20240827
react-dom: 19.0.0-rc-7771d3a7-20240827
typescript: 5.3.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Vercel (Deployed)
Additional context
No response
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
Open the linked CodeSandbox and run the reproduction steps with a non-en locale. Trace the dynamic locale segment and its nested catch-all route, then verify that /de returns a 404 when the segment sets dynamicParams = false and de is absent from its static params.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- 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
- 42/100