Description
Link to the code that reproduces this issue
https://github.com/ferrata/nextjs-dynamic
To Reproduce
- Go to the test page
- The page shows params that were passed, and they are different from the expected:

Current vs. Expected behavior
The page should receive correct params:
{
"locale": "en",
"rest": [
"folder",
"page"
]
}
But instead receives incorrect params:
{
"locale": "folder",
"rest": [
"page"
]
}
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 18.20.2
npm: 10.5.0
Yarn: N/A
pnpm: 9.15.4
Relevant Packages:
next: 15.3.0-canary.31 // Latest available version is detected (15.3.0-canary.31).
eslint-config-next: 15.2.4
react: 19.1.0
react-dom: 19.1.0
typescript: 5.8.2
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Dynamic Routes
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
Under certain conditions, for a page with dynamic route an incorrect params are passed to the page
The error is reproducing for me when the following conditions are met:
- the page in question has a dynamic route
- the parent route of the dynamic route has PPR (Partial Prerendering) enabled
- a middleware is used to rewrite an original URL to patch a route (prepend a locale in my case)
- the project is deployed on Vercel
Important
Note 1: The issue is not reproducible locally.
Important
Note 2: The parameters are passed correctly when navigating to the page from another route. The issue reproduces only when the page is loaded directly, or by refreshing the page.