Repository: next.js
Issue: app.prepare() won't resolve in custom server after next 13.4.13
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP Wed Nov 30 09:32:06 EST 2022
    Binaries:
      Node: 16.20.1
      npm: 9.8.1
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.20-canary.3
      eslint-config-next: 13.4.12
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A
```


### Which area(s) of Next.js are affected? (leave empty if unsure)



### Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/ecstatic-robinson-fyd2n6?file=%2Fpackage.json%3A9%2C31

### To Reproduce

Upload next app with version >13.4.13 to custom server (under cpanel following these [instructions](https://medium.com/@geevadon/how-to-deploy-a-next-js-app-on-cpanel-efficiently-c00c5eb860de)) with server.js as:
``` js
const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')
 
const dev = process.env.NODE_ENV !== 'production'
const hostname = 'localhost'
const port = 3000
// when using middleware `hostname` and `port` must be provided below
const app = next({ dev, hostname, port })
const handle = app.getRequestHandler()
 
app.prepare().then(() => {
  createServer(async (req, res) => {
    try {
      // Be sure to pass `true` as the second argument to `url.parse`.
      // This tells it to parse the query portion of the URL.
      const parsedUrl = parse(req.url, true)
      const { pathname, query } = parsedUrl
 
      if (pathname === '/a') {
        await app.render(req, res, '/a', query)
      } else if (pathname === '/b') {
        await app.render(req, res, '/b', query)
      } else {
        await handle(req, res, parsedUrl)
      }
    } catch (err) {
      console.error('Error occurred handling', req.url, err)
      res.statusCode = 500
      res.end('internal server error')
    }
  })
    .once('error', (err) => {
      console.error(err)
      process.exit(1)
    })
    .listen(port, () => {
      console.log(`> Ready on http://${hostname}:${port}`)
    })
})
```



### Describe the Bug

with Next.js 13.4.12 the apps starts and runs my app, but when I install any version over 13.4.13 it seems app.prepare().then is not resolving and therefore, the server is not started and all I can see is an empty html on my website. The stderr.log is empty and therefore there is no error I can see to debug.  On my local installation is working, but on my server, as soon as I update next to 13.4.13 or more, it stops working.

The sandbox I created is also working since I cannot reproduce the same conditions as in a shared hosting with cPanel. 

I have tried the latest next.js version to no avail.

### Expected Behavior

The application starts on custom server with Next.js >13.4.13

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

shared hosting, custom server