Repository: next.js
Issue: DYNAMIC_SERVER_USAGE error with parallel and/or intercepted routes
Labels: Runtime,Parallel & Intercepting Routes

### Link to the code that reproduces this issue

https://github.com/diamondT/with-modal-app

### To Reproduce

1. build application with `npm run build`
2. start with `npm run start`
3. navigate to `http://localhost:3005`
4. click on the "Create an address" button

### Current vs. Expected behavior

### Current behavior
`Application error: a server-side exception has occurred (see the server logs for more information).
Digest: DYNAMIC_SERVER_USAGE`

### Expected Behavior
Clicking the button should navigate to `http://localhost:3005/address/create?type=A` and update the content accordingly

The page in question is using `searchParams`.

### Provide environment information

```bash
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Thu Nov 14 12:54:01 UTC 2024 (099023b)
  Available memory (MB): 31992
  Available CPU cores: 16
Binaries:
  Node: 22.9.0
  npm: 10.8.3
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.1.1 // Latest available version is detected (15.1.1).
  eslint-config-next: 15.1.1
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Parallel & Intercepting Routes, Runtime

### Which stage(s) are affected? (Select all that apply)

next build (local), next start (local)

### Additional context

When running the application in dev mode with `npm run dev`, everything works as expected.

Manually marking the page as dynamic with `export const dynamic = 'force-dynamic'` also works as expected.

Since the page is using `searchParams`, it should be marked as a dynamic route. The same page as a regular route is indeed identified as dynamic, however the intercepted route is not. Build output:
```
...
 ✓ Compiled successfully
 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
Error: Static generation failed due to dynamic usage on /address/create, reason: `await searchParams`, `searchParams.then`, or similar
    at m (.next/server/chunks/638.js:1:41139)
    at Object.get (.next/server/chunks/584.js:3:29779)
    at a (.next/server/app/address/create/page.js:1:3367)
    at stringify (<anonymous>)
 ✓ Generating static pages (7/7)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    


Redirects
┌ source: /:path+/
├ destination: /:path+
└ permanent: true


Rewrites
┌ source: /address/create
└ destination: /(.)address/create


Route (app)                              Size     First Load JS
┌ ○ /                                    3.74 kB         109 kB
├ ○ /_not-found                          979 B           106 kB
├ ○ /(.)address/create                   142 B           105 kB
└ ƒ /address/create                      142 B           105 kB
+ First Load JS shared by all            105 kB
  ├ chunks/4bd1b696-92810b4b4ece63ad.js  52.9 kB
  ├ chunks/517-cf90ad66b32a8bbf.js       50.5 kB
  └ other shared chunks (total)          1.88 kB


○  (Static)   prerendered as static content
ƒ  (Dynamic)  server-rendered on demand


Process finished with exit code 0
```