Skip to content

Commit d2c9b64

Browse files
authored
fix: CLI dev command doesn't work if you're already running ngrok (#407)
* fix: CLI dev command doesn't work if you're already running ngrok * added changeset
1 parent 3102dec commit d2c9b64

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.changeset/lovely-beers-collect.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/cli": patch
3+
---
4+
5+
provided a fix to the CLI dev command tunnel not working if you are already running ngrok

packages/cli/src/commands/dev.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,16 @@ async function createTunnel(port: number, spinner: Ora) {
258258
return;
259259
}
260260
}
261+
if (
262+
typeof error.message === "string" &&
263+
error.message.includes("connect ECONNREFUSED 127.0.0.1:4041")
264+
) {
265+
spinner.fail(
266+
`Ngrok failed to create a tunnel for port ${port} because ngrok is already running`
267+
);
268+
return;
269+
}
270+
spinner.fail(`Ngrok failed to create a tunnel for port ${port}.\n${error.message}`);
261271
return;
262272
}
263273
}

0 commit comments

Comments
 (0)