app router does not resolve routes according to `generateStaticParams` constraints
Open
Nobody has claimed this yet.
bug
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.5k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://stackblitz.com/edit/stackblitz-starters-941nyd
To Reproduce
- click on "post 2" → it's a post
- click on "post 1" → it's a post
- click on "page 2" → it's a post
- click on "page 1" → it's a post
Current vs. Expected behavior
the "pages" urls should resolve with the page route, not the post route.
Provide environment information
irrelevant, happens in stackblitz too.
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
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
Start with the linked StackBlitz reproduction and run it in next dev, following the four navigation steps involving post and page routes. Inspect the app router's handling of generateStaticParams constraints and compare which route resolves each URL. Done means the pages URLs resolve with the page route instead of the post route.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, next.js, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100