-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
ECONNREFUSED with NextJS custom server #52215
Comments
Nevermind, I think the issue was that I was not passing const nextApp = next({ dev, dir, hostname, port }) // <-- missing hostname, port |
I confirmed that was the issue. Apologies! Thank you! |
Thank you worked for me also |
add localhost as hostname didn't work used 127.0.0.1 instead |
Thank you this worked for me |
Changing |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 Binaries: Node: 18.16.1 npm: 9.5.1 Yarn: N/A pnpm: N/A Relevant Packages: next: 13.4.9-canary.1 eslint-config-next: 13.4.1 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)
https://github.com/vercel/next.js/blob/canary/examples/custom-server/server.ts
Link to the code that reproduces this issue or a replay of the bug
https://github.com/michaelangrivera/nextjs-bug
To Reproduce
Describe the Bug
When trying to serve my application via a custom node server, I get the following error:
I understand the reproduction steps contain an NX monorepo; however, I think NX is unrelated. I think potentially related issues may be:
TLDR on how the repro repo works:
apps/next/server/main.ts
(here)main.js
output compiled fromapps/next/server/main.ts
I'm not sure if setting the
hostname
to127.0.0.1
is an actual fix since deploying to Fly.io would give me the following error:Note: this does not occur with Node.js <17
I wonder if #51887 will solve the issue.
Expected Behavior
I should be able to run the custom server without issue locally and deploy it as a container.
If you install
13.4.1
, you will see the app works.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
standalone, custom server
The text was updated successfully, but these errors were encountered: