@fabricorg/experiments 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/fx.cjs CHANGED
@@ -5730,9 +5730,33 @@ async function cmdDev(options = {}) {
5730
5730
  log(`ERR ${err.message}`);
5731
5731
  }
5732
5732
  });
5733
- await new Promise(
5734
- (resolveStart) => server.listen(port, "127.0.0.1", () => resolveStart())
5735
- );
5733
+ try {
5734
+ await new Promise((resolveStart, rejectStart) => {
5735
+ server.once("error", rejectStart);
5736
+ server.listen(port, "127.0.0.1", () => {
5737
+ server.off("error", rejectStart);
5738
+ resolveStart();
5739
+ });
5740
+ });
5741
+ } catch (e) {
5742
+ const err = e;
5743
+ if (err.code === "EADDRINUSE") {
5744
+ process.stderr.write(
5745
+ `fx dev: port ${port} is already in use.
5746
+
5747
+ Another fx dev server may already be running. Either stop that process or choose another port:
5748
+
5749
+ fx dev --port ${port + 1}
5750
+
5751
+ To find the process on Linux/macOS:
5752
+
5753
+ lsof -nP -iTCP:${port} -sTCP:LISTEN
5754
+ `
5755
+ );
5756
+ return 1;
5757
+ }
5758
+ throw e;
5759
+ }
5736
5760
  log(`fx dev \u2014 listening on http://127.0.0.1:${port}`);
5737
5761
  log(` GET /manifest`);
5738
5762
  log(` POST /v1/exposure`);
@@ -6006,7 +6030,7 @@ GLOBAL FLAGS
6006
6030
  -h, --help print this help
6007
6031
  -v, --version print version
6008
6032
  `;
6009
- var VERSION2 = "0.5.2";
6033
+ var VERSION2 = "0.5.3";
6010
6034
  function parse(argv) {
6011
6035
  const positional = [];
6012
6036
  const flags = {};