Giter VIP home page Giter VIP logo

Comments (7)

nbouvrette avatar nbouvrette commented on May 28, 2024 1

On macOS 13.2.1, netstat -lnt | grep 3000:

tcp6       0      0  ::1.3000                                      ::1.61369                                     ESTABLISHED
tcp6       0      0  ::1.61369                                     ::1.3000                                      ESTABLISHED
tcp6       0      0  ::1.3000                                      ::1.61368                                     ESTABLISHED
tcp6       0      0  ::1.61368                                     ::1.3000                                      ESTABLISHED

And

  • curl -I http://localhost:3000 was successful HTTP/1.1 200 OK
  • curl -I http://[::1]:3000 was successful HTTP/1.1 200 OK

from start-server-and-test.

MikeMcC399 avatar MikeMcC399 commented on May 28, 2024 1

@nbouvrette

Thanks very much for your detailed answer! I do understand that you are looking for a "proper" fix! I logged a separate issue jeffbski/wait-on#137 regarding the underlying technology in an attempt to get a proper fix. From my point of view there isn't a need to research your issue any deeper, since it is already clear.

  • The simplest outcome would be if the issue jeffbski/wait-on#137 were to be resolved with a new release of wait-on. Hopefully there will be a response from the maintainer there soon.
  • Another theoretical possibility would be to move start-server-and-test to use the fork https://github.com/metcoder95/wait-on where the issue is resolved, however it seems that the creator of the fork doesn't intend it to be a long-term solution.

You don't need to do anything more on your repo for my benefit. Thanks for correcting the typo about the npm install command in any case!

from start-server-and-test.

MikeMcC399 avatar MikeMcC399 commented on May 28, 2024

@nbouvrette

Thanks for the logs and information!

The logs show:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000

making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: connect ECONNREFUSED ::1:3000

For comparison:

In my own different test Next.js environment on Ubuntu (simple starter). I see it is successfully trying to contact http://localhost:3000 via ::1:3000.

On ubuntu

netstat -lnt | grep 3000

showed

tcp6       0      0 :::3000                 :::*                    LISTEN
  • curl -I http://localhost:3000 was successful HTTP/1.1 200 OK
  • curl -I http://[::1]:3000 was successful HTTP/1.1 200 OK

I suspect on your system that you may get a different result for netstat -lnt | grep 3000 and that curl -I http://[::1]:3000 will fail. If that is the case you might be able to get help from your Next.js community or Stackoverflow to get the server to also listen on the IPv6 address ::1.

(I cloned your repository and tried to follow your instructions in an Ubuntu environment, however that didn't work for me. I don't want to spend time now getting that to work as your debug logs showed enough of the problem. Also I don't have a macOS system so even if it did work for me I can't be sure that I am emulating your environment.)

from start-server-and-test.

MikeMcC399 avatar MikeMcC399 commented on May 28, 2024

@nbouvrette

Thanks for the additional debug information. I don't understand in that case why

HTTP(S) error for http://localhost:3000 Error: connect ECONNREFUSED ::1:3000

is happening. It probably needs somebody with better network know-how than I have to work out why it's failing.

Edit: The command netstat -lnt | grep 3000 is for Ubuntu and it may not be exactly right for macOS. See if you can find how to display listeners on macOS. That was the intention.

from start-server-and-test.

MikeMcC399 avatar MikeMcC399 commented on May 28, 2024

@nbouvrette

There is a possibility that you could start your server on host 0.0.0.0 and that your results might be different doing that. Check your documentation. -h 0.0.0.0 might do it. I have had mixed results with similar experiments. On Vite --host made a positive difference, with react HOST=0.0.0.0 didn't help.

from start-server-and-test.

MikeMcC399 avatar MikeMcC399 commented on May 28, 2024

@nbouvrette

Regarding your repository https://github.com/Avansai/next-multilingual , if you want to make this better to use, I would suggest to create a new branch with your changes in it, then test it by cloning to a clean system. That way you can see if there is anything missing. I suspect that you may have some modules globally installed.

I cloned https://github.com/Avansai/next-multilingual
I guessed you meant npm install not npm run install

npm run e2e for instance gives
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@next/bundle-analyzer'

from start-server-and-test.

nbouvrette avatar nbouvrette commented on May 28, 2024

@MikeMcC399 the netstat command I ran was showing listener - my port 3000 is the one that was of interest (running Next.js)

Regarding your suggestion to use -h 0.0.0.0 - for me it's the same as just using 127.0.0.1 in my scripts - basically a workaround. I do have a workaround already. This issue was meant to find a fix to the issue.

Regarding https://github.com/Avansai/next-multilingual, you are correct, you need to run npm install (I updated the original instructions)

There are no global modules installed, the instructions should work as-is - if not please let me know and I will update anything that might be missing.

I have shared this repository on several other GitHub issues in other repos and it usually works well without needing to create a branch. If there is any issue reproducing the problem, I can try to create a minimal-reproduction repo just for this but of course, this will take more time for me to get setup

from start-server-and-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.