webpack-dev-server icon indicating copy to clipboard operation
webpack-dev-server copied to clipboard

Unable to catch error thrown by Server on port conflict

Open subodhkumar opened this issue 3 years ago • 2 comments

We have a wrapper on top of webpack-dev-server. With webpack 4, when we started dev-server passing a port which was occupied we were getting EDDRINUSE logged in the console. However, with webpack5 we do not see it getting logged & unable to catch the error thrown by the server in our wrapper code.

Any suggestion on how to handle it & catch the error emitted.

Thanks in advance

subodhkumar avatar Jan 25 '23 07:01 subodhkumar

webpack-dev-server has static helper https://github.com/webpack/webpack-dev-server/blob/d1d14340d34ed5e5a97293cee09f49a85428c46f/lib/Server.js#L391, you can use it and assign to the port option

alexander-akait avatar Feb 10 '23 19:02 alexander-akait

Closing due to inactivity. Thanks!

alexander-akait avatar Feb 08 '24 13:02 alexander-akait