Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Give user hint that port is not free
  • Loading branch information
fastner committed Mar 1, 2018
commit 5b449767cf4bd4a7289c8b056afc840835f2bce1
8 changes: 7 additions & 1 deletion packages/edge-builder/src/webpack/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,15 @@ export function connectWithWebpack(server, multiCompiler) {
serverIsStarted = true

try {
const serverPort = await getPort(process.env.SERVER_PORT)
const expectedPort = parseInt(process.env.SERVER_PORT, 10)
const serverPort = await getPort(expectedPort)

server.listen(serverPort, () => {
if (serverPort !== expectedPort) {
console.log(
`Port ${expectedPort} is not free. Using ${serverPort} instead`
)
}
notify(`Server started at port ${serverPort}`, "info")

writeToClipboard(`http://localhost:${serverPort}`)
Expand Down