Repository: next.js
Issue: cls-hooked not worked in request processed by next server
Labels: bug,Runtime,Pages Router

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64
    Binaries:
      Node: 18.15.0
      npm: 9.5.0
      Yarn: 1.22.18
      pnpm: N/A
    Relevant Packages:
      next: 13.4.10-canary.1
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 4.9.5
    Next.js Config:
      output: N/A
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

Data fetching (gS(S)P, getInitialProps), Middleware / Edge (API routes, runtime)

### Link to the code that reproduces this issue or a replay of the bug

https://github.com/sedx/cls-hooked-next-issue

### To Reproduce

1. startup server from example repo  - `npm start`
2. open page in browser
3. check stdout for logs

### Describe the Bug

For each request handled by custom server we [generate](https://github.com/sedx/cls-hooked-next-issue/blob/main/server.ts#L33) uniq request ID. This request ID used for logging purpose.

To easy access anywhere  on server (api routes, `getServerSideProps`, etc) we [put](https://github.com/sedx/cls-hooked-next-issue/blob/main/lib/requestId/requestId.server.ts#L14) this ID to namespace created by `cls-hooked` package (it's based on Node's async_hooks API).

In response handlers executed directly it's works fine and logger can access to Request IT.
For response processed by handler from ` app.getRequestHandler()` it doesn't. [Access](https://github.com/sedx/cls-hooked-next-issue/blob/main/lib/requestId/requestId.server.ts#L20) to `cls-hooked` namespace return `undefined`.



### Expected Behavior

In Next's `getServerSideProps` and api routes handlers call of `clsNamespace.get()` should return value was set by call of `clsNamespace.set()` early.

In logs from example app should be actual request ID instead of FAKE_SERVER_REQUEST_ID:

```
Start process request: c999ae57-83fb-4759-855a-78a1b51253e9 - /
FAKE_SERVER_REQUEST_ID: Home#getServerSideProps called                              // <---- c999ae57-83fb-4759-855a-78a1b51253e9 should be here instead of FAKE_SERVER_REQUEST_ID
Finish process request: c999ae57-83fb-4759-855a-78a1b51253e9 - /
  
Start process request: d8569ad6-1bb5-433d-8fc7-324bee707d26 - /favicon.ico
Finish process request: d8569ad6-1bb5-433d-8fc7-324bee707d26 - /favicon.ico
  
Start process request: e6991efc-456f-493f-a015-4c5ce66290fc - /rawServer/requestId
Start process request: a85559a4-0e90-4b77-8287-30a0a4c88db6 - /api/requestId
FAKE_SERVER_REQUEST_ID: /api/requestId called                                      //  <----- e6991efc-456f-493f-a015-4c5ce66290fc should be here instead of FAKE_SERVER_REQUEST_ID
Finish process request: a85559a4-0e90-4b77-8287-30a0a4c88db6 - /api/requestId
e6991efc-456f-493f-a015-4c5ce66290fc: /rawServer/requestId                         // <--- here all is fine
Finish process request: e6991efc-456f-493f-a015-4c5ce66290fc - /rawServer/requestId
```

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_