Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next/dist/build never ends #54494

Closed
1 task done
dcousens opened this issue Aug 24, 2023 · 2 comments
Closed
1 task done

next/dist/build never ends #54494

dcousens opened this issue Aug 24, 2023 · 2 comments
Labels
bug Issue was opened via the bug report template. locked

Comments

@dcousens
Copy link

dcousens commented Aug 24, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP PREEMPT_DYNAMIC Tue, 08 Aug 2023 22:15:00 +0000
    Binaries:
      Node: 18.16.0
      npm: 9.8.1
      Yarn: 1.22.19
      pnpm: 8.6.10
    Relevant Packages:
      next: 13.4.20-canary.4
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: N/A
    Next.js Config:
      output: N/A

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

No response

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

https://github.com/dcousens/next-build-bug

To Reproduce

corepack enable
pnpm install
node build.js

Describe the Bug

Consider the following code

const nextBuild = require('next/dist/build').default
const path = require('path')

async function main () {
  console.log('building')
  await nextBuild(path.join(process.cwd(), 'app/'))
  console.log('built')
}
main()

This should build app/, and the process should end.

The bug

The process stays open because a HTTP server has been started for some reason, and is listening on a random port

$ ss -natup
Netid    State     Recv-Q    Send-Q     Local Address:Port     Peer Address:Port       Process
tcp      LISTEN    0         511        *:34441                *:*                     users:(("node",pid=392310,fd=33))

Fwiw, the HTTP server doesn't call .end when requests are made either, but it does respond with a 200

$ curl -v http://127.0.0.1:34441
* processing: http://127.0.0.1:34441
*   Trying 127.0.0.1:34441...
* Connected to 127.0.0.1 (127.0.0.1) port 34441
> GET / HTTP/1.1
> Host: 127.0.0.1:34441
> User-Agent: curl/8.2.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 24 Aug 2023 10:31:36 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
< Content-Length: 0
<
* Connection #0 to host 127.0.0.1 left intact

Expected Behavior

The process should end, and no HTTP server should be started

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@balazsorban44
Copy link
Member

next/dist/build is not a documented way of building, so this is not covered by semver/should not be used.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Sep 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

No branches or pull requests

2 participants