akd-io / create-next-stack

Create Next Stack is a website and CLI tool used to easily set up the boilerplate of new Next.js apps.
https://www.create-next-stack.com
MIT License
561 stars 27 forks source link

Server Error: TCPConnectWrap.afterConnect [as oncomplete] #238

Closed yalin closed 1 year ago

yalin commented 1 year ago

Having this error after I created a new project and then npm run dev;

Screenshot from 2023-06-12 23-25-48

- ready started server on 0.0.0.0:3000, url: http://localhost:3000
- event compiled client and server successfully in 142 ms (18 modules)
- wait compiling...
- event compiled client and server successfully in 114 ms (18 modules)
- wait compiling / (client and server)...
- event compiled client and server successfully in 961 ms (1249 modules)
- error Error: connect ECONNREFUSED 127.0.0.1:35457
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1532:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 35457
}

How can I solve this?

akd-io commented 1 year ago

Hey @yalin,

I have never encountered this error, and unfortunately, I don't have any good ideas as to what could be wrong.

If you are able to provide me with a repository with a reproduction, I'd like to take a look.

Otherwise, I think the official Next.js discord or GitHub might be your best bet, unless you got any errors running create-next-stack, but it seems like you didn't.

yalin commented 1 year ago

Hey @akd-io ,

I created the repository that you asked for; here. I will delete it after the bug fix.

I also want to write about how I created; I got the creation command from the website https://www.create-next-stack.com/

npx create-next-stack@0.2.8 --package-manager=npm --styling=emotion --react-hook-form --prettier --formatting-pre-commit-hook --chakra --react-icons --framer-motion --github-actions --react-query --vercel cns-app

But I didn't use this command. Instead, I installed npm https://www.npmjs.com/package/create-next-stack with the command;

npm i -g create-next-stack

Then I used;

create-next-stack --package-manager=npm --styling=emotion --react-hook-form --prettier --formatting-pre-commit-hook --chakra --react-icons --framer-motion --github-actions --react-query --vercel cns-app

which I believe their purpose is the same.

Also; npm version: 9.6.6 create-next-stack version: create-next-stack/0.2.8 linux-x64 node-v19.8.1 I am using Pop!_OS 22.04 LTS x86_64

akd-io commented 1 year ago

Hi, and thanks for getting back to me with more details!

I believe you are correct that installing create-next-stack globally should be just as fine. You could, end up getting out of sync over time if you forget to update it, but if the version is correct, as in this case, it should be all good.

I checked out your linked repository and tried running npm run dev in the project myself. Unfortunately (?) it worked fine on my machine, so I still don't know what the problem is.

akd@AMBP cns-app-main % npm run dev

> cns-app@0.1.0 dev
> next dev

- ready started server on 0.0.0.0:3000, url: http://localhost:3000
- event compiled client and server successfully in 129 ms (18 modules)
- wait compiling...
- event compiled client and server successfully in 59 ms (18 modules)
- wait compiling / (client and server)...
- event compiled client and server successfully in 1846 ms (1249 modules)

I think I will have to close this issue, as I don't think it has to do with the Create Next Stack tool in particular, but rather Next.js og Node.js having trouble running on your machine.

I run end-to-end tests on Windows, Ubuntu and MacOS on every pull request, and don't have the time to support others unfortunately.

akd-io commented 1 year ago

If anybody else runs into this issue, please @ me, and I'll reopen.