Snowpack: Select next available port if port is already taken

Created on 30 May 2020  路  5Comments  路  Source: snowpackjs/snowpack

Original Discussion: https://www.pika.dev/npm/snowpack/discuss/264
/cc @bjarkihall, @FredKSchott

Currently, we throw a gross-looking error if the 8080 port is taken. Instead, we should:

  • [x] PR 1: Return well-formatted output, saying that the port is taken, and that they can use --port to specify a different port.
  • [ ] PR 2: Instead of exiting, ask the user if it should use the next available port instead. If yes, do it.
good first issue help wanted

All 5 comments

@FredKSchott This will also need to modify the HMR port as well

Great call. There's a PR to default to using the same port for HMR, which I think would solve for this as well, since we're only talking about this feature for the default "no explicit port defined" user.

https://github.com/pikapkg/snowpack/pull/365

@jihchi Are you planning on tackling the second PR? If not, I will try tackling it.

@stramel please go ahead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daniele-orlando picture daniele-orlando  路  6Comments

FredKSchott picture FredKSchott  路  6Comments

FredKSchott picture FredKSchott  路  7Comments

FredKSchott picture FredKSchott  路  6Comments

FredKSchott picture FredKSchott  路  6Comments