SAFE-template icon indicating copy to clipboard operation
SAFE-template copied to clipboard

Port 8080 already in use

Open forki opened this issue 4 years ago • 5 comments

It's very common that port 8080 already in use. In order to make it easier for newcomers I propose we got to something more random like 8093

forki avatar Jan 28 '20 11:01 forki

Please no, port 8080 is very common to use in front-end development and using a random will only confuse people. In modern Vue.js applications, the CLI tool will check whether 8080 is already in use and use it if that is the case, otherwise, it will increment by 1 -> try with 8081. The process repeats until the project finds a free port, maybe SAFE can do something like that

Zaid-Ajaj avatar Jan 28 '20 11:01 Zaid-Ajaj

port 8080 is very common to use in front-end development

that's the problem I want to solve. 2 of my coworkers failed with the template today because other stuff is running there.

I'm not saying "random" one as in every time a new one. I meant let's pick one for the template where it's less likely to get a conflict

forki avatar Jan 28 '20 11:01 forki

2 of my coworkers failed with the template today because other stuff is running there.

What other stuff do you mean? Other websites in development or some other utility that they want to always keep running? If it's other dev websites, I feel they should be aware of what they have running for development. And other utililities shouldn't really be permanently using up such a common port.

The current error message isn't particularly understandable and it contains a lot of noise:

watch : Started
> "http://localhost:8080"  (In: false, Out: false, Err: false)
Bundling for development...
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 0.0.0.0:8080
    at Server.setupListenHandle [as _listen2] (net.js:1334:14)
    at listenInCluster (net.js:1382:12)
    at doListen (net.js:1508:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
Emitted 'error' event at:
    at emitErrorNT (net.js:1361:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

EADDRINUSE 0.0.0.0:8080 is not a user friendly message... Maybe we could catch this error, kill the client and server and exit the FAKE script with an understandable error that explains that you need to close other apps using this port or change the port being used.

Changing the template to use a different hard-coded port only partially solves the problem because if you will get the same error if you already have another SAFE template app open. I think Zaid's idea of finding an available port is a better solution, and then we would start webpack with an environment variable set to the port number. We would also want do this with the server proxy port (which defaults to 8085) in case there is another SAFE app running.

theprash avatar Jan 28 '20 12:01 theprash

Concrete it's Microsoft dynamics NAV. So it's an app server that is very very common in Germany and Denmark.

Prash [email protected] schrieb am Di., 28. Jan. 2020, 13:16:

2 of my coworkers failed with the template today because other stuff is running there.

What other stuff do you mean? Other websites in development or some other utility that they want to always keep running? If it's other dev websites, I feel they should be aware of what they have running for development. And other utililities shouldn't really be permanently using up such a common port.

The current error message isn't particularly understandable and it contains a lot of noise:

watch : Started

"http://localhost:8080" (In: false, Out: false, Err: false) Bundling for development... events.js:167 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE 0.0.0.0:8080 at Server.setupListenHandle [as _listen2] (net.js:1334:14) at listenInCluster (net.js:1382:12) at doListen (net.js:1508:7) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:745:11) at startup (internal/bootstrap/node.js:266:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3) Emitted 'error' event at: at emitErrorNT (net.js:1361:8) at process._tickCallback (internal/process/next_tick.js:63:19) [... lines matching original stack trace ...] at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

EADDRINUSE 0.0.0.0:8080 is not a user friendly message... Maybe we could catch this error, kill the client and server and exit the FAKE script with an understandable error that explains that you need to close other apps using this port or change the port being used.

Changing to another port only partially solves the problem because if you will get the same error if you already have another SAFE template app open. I think Zaid's idea of finding an available port is a better solution, and then we would start webpack with an environment variable set to the port number. We would also want do this with the server proxy port (which defaults to 8085) in case there is another SAFE app running.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SAFE-Stack/SAFE-template/issues/332?email_source=notifications&email_token=AAAOANGNKU65W722OYTPLZDRAAOYNA5CNFSM4KMQ7XXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKDCVSI#issuecomment-579218121, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOANAU6KPK4CKCEUWRSX3RAAOYNANCNFSM4KMQ7XXA .

forki avatar Jan 28 '20 12:01 forki

image I am trying to run m first react native android app in my physical device but i am facing this error kinddly help me to fix that

prashantkr006 avatar Nov 08 '21 08:11 prashantkr006

This discussion hasn't really seen any action for a long time so I'll close it down, feel free to reopen if you feel it is still relevant

teknikal-wizard avatar Nov 11 '22 15:11 teknikal-wizard